Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect optimization of 'typeof null' causes false positives #7350

Closed
michaelshopsin opened this issue Jun 21, 2016 · 3 comments
Closed

Incorrect optimization of 'typeof null' causes false positives #7350

michaelshopsin opened this issue Jun 21, 2016 · 3 comments
Labels
v8 engine Issues and PRs related to the V8 dependency.

Comments

@michaelshopsin
Copy link

  • 6.2.2:
  • Darwin XCF032616035008 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64:
  • Core:

There is a serious bug in Node.js where typeof null comparison changes inside a loop. This bug is reported on StackOverflow, Reddit, and Chrome. The sample code from StackOverflow should always return false but becomes true when the bug is present:

function foo() {
    return typeof null === 'undefined';
}
for(var i = 0; i < 1000; i++) console.log(foo());

verwaest on GitHub committed a fix for the bug to v8 but Node.js 6.2.2 still has the bug. Errors in typeof is a very serious regression and will cause undefined behavior.

@MylesBorins
Copy link
Contributor

A backport PR is already in. We are just figuring out if we want to float a patch or have it backported to specific V8 release lines

@MylesBorins
Copy link
Contributor

#7348

@michaelshopsin
Copy link
Author

This for pointing out that the backport of the fix is already in progress. I'm going to close my issue as a duplicate.

@ChALkeR ChALkeR added the v8 engine Issues and PRs related to the V8 dependency. label Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

3 participants