-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cherry-pick patch from V8 upstream that fixes instanceof problem #7638
Conversation
I think you may want to switch the order of the commits here, so that there is no point in the history in which |
Oh, you're totally right. Done. |
@@ -0,0 +1,7 @@ | |||
'use strict'; | |||
require('../common'); | |||
var assert = require('assert'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use const
here and below?
I changed the commit message and the test. @bnoordhuis can you have another look, please? |
LGTM |
@bnoordhuis I started playing with making a backport / cherry-pick guide. Is there any other "unwritten rules" you can think of? |
@thealphanerd "Run the V8 and node.js test suite on the CI". That's about it. EDIT: "Don't forget to bump the patchlevel..." |
FreeBSD has an 'interesting' error:
Not sure what's up with that. Looks like ppc little-endian ubuntu is failing though, and the v8 CI also seems to have some failures.
|
I think it's because it's missing the PPC changes from v8/v8@3a903c4. |
Quite possible that there are similar changes for s390 as well. Will look at adding s390 to the v8 test job as well. |
It doesn't matter for this particular patch (no s390 in v6) but it would be good in general. |
Thanks for running the CI. I'll add the PPC and X87 patches. |
I cherry-picked the patches for the remaining architectures (not for s390 because it's not in v6). Can you have another look, please? |
Do I need to bump the patch level or are we only doing that for 5.1? |
Yes, please bump the patchlevel. |
92345b7
to
6657bd3
Compare
Bumped and rebased, so test is added after cherry-picks. |
LGTM. |
Original commit message: InstanceOfStub incorrectly interprets the hole as a prototype. Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. R=verwaest@chromium.org BUG= Committed: https://crrev.com/2aa070be4fd2960df98905b254f12ed801ef26cd Cr-Commit-Position: refs/heads/master@{#34863} This fixes the behavior of instanceof when the second parameter is not a constructor. Fixes: #7592 PR-URL: #7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: PPC: InstanceOfStub incorrectly interprets the hole as a prototype. Port 2aa070b Original commit message: Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com BUG= Review URL: https://codereview.chromium.org/1811013002 Cr-Commit-Position: refs/heads/master@{#34869} Fixes: #7592 for PPC PR-URL: #7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: port 2aa070b (r34863) original commit message: Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. BUG= Review URL: https://codereview.chromium.org/1809333002 Cr-Commit-Position: refs/heads/master@{#34880} Fixes: #7592 for X87 PR-URL: #7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
PR-URL: #7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Notable changes: * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) #7602 * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) #7176 * **deps**: * Upgrade to V8 5.0.71.xx. (Ben Noordhuis) #7531 * Backport V8 instanceof bugfix (Franziska Hinkelmann) #7638 * **repl**: Fix issue with function redeclaration. (Prince J Wesley) #7794 * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) #7641 PR-URL: #7782
landed in v6.x in 71f84b5...164981a. Thanks! |
Notable changes: * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) #7602 * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) #7176 * **deps**: * Upgrade to V8 5.0.71.xx. (Ben Noordhuis) #7531 * Backport V8 instanceof bugfix (Franziska Hinkelmann) #7638 * **repl**: Fix issue with function redeclaration. (Prince J Wesley) #7794 * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) #7641 PR-URL: #7782
I would have preferred it if this PR had landed as a single commit. We now have commits in our history where the build is known broken on some architectures, making things like git-bisect more difficult. |
@bnoordhuis I'm not sure I understand your concern. The test is added after the three cherry-picks, I don't think the build is broken in any of the revisions. Should bumping the patch level be a separate commit or squashed? @thealphanerd where's your cherry-pick guide? |
Sorry, I must have been thinking of another PR. You're right, here it was just the test that was failing without the PPC changes. I have a preference for bumping the patch level in the same commit. It makes it an atomic unit, easy to roll back. |
Original commit message: InstanceOfStub incorrectly interprets the hole as a prototype. Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. R=verwaest@chromium.org BUG= Committed: https://crrev.com/2aa070be4fd2960df98905b254f12ed801ef26cd Cr-Commit-Position: refs/heads/master@{#34863} This fixes the behavior of instanceof when the second parameter is not a constructor. Fixes: nodejs/node#7592 PR-URL: nodejs/node#7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: PPC: InstanceOfStub incorrectly interprets the hole as a prototype. Port 2aa070b Original commit message: Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com BUG= Review URL: https://codereview.chromium.org/1811013002 Cr-Commit-Position: refs/heads/master@{#34869} Fixes: nodejs/node#7592 for PPC PR-URL: nodejs/node#7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: port 2aa070b (r34863) original commit message: Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. BUG= Review URL: https://codereview.chromium.org/1809333002 Cr-Commit-Position: refs/heads/master@{#34880} Fixes: nodejs/node#7592 for X87 PR-URL: nodejs/node#7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
PR-URL: nodejs/node#7638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
### Notable changes * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) [#7602](nodejs/node#7602) * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) [#7176](nodejs/node#7176) * **deps**: * Upgrade to V8 5.0.71.xx. (Ben Noordhuis) [#7531](nodejs/node#7531) * Backport V8 instanceof bugfix (Franziska Hinkelmann) [#7638](nodejs/node#7638) * **repl**: Fix issue with function redeclaration. (Prince J Wesley) [#7794](nodejs/node#7794) * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) [#7641](nodejs/node#7641)
@fhinkel do you think this should also land on |
@rvagg You mean if the test should be ported to master? Yes, let me do that. Then we can let this die with v6.x. |
@fhinkel yeah, thanks, it came up as one of the commits on v6.x that are not on v7.x and I just wanted clarification regarding whether this should live on beyond v6.x and getting it on master is obviously the way to do that. |
Add regression test for issue nodejs#7592. The issue was fixed in upstream V8 and this test case was previously added with a manual cherry pick for v6.x. Related to: nodejs#7638 and nodejs#7592.
Add regression test for issue #7592. The issue was fixed in upstream V8 and this test case was previously added with a manual cherry pick for v6.x. Related to: #7638 and #7592. PR-URL: #9178 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add regression test for issue #7592. The issue was fixed in upstream V8 and this test case was previously added with a manual cherry pick for v6.x. Related to: #7638 and #7592. PR-URL: #9178 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add regression test for issue #7592. The issue was fixed in upstream V8 and this test case was previously added with a manual cherry pick for v6.x. Related to: #7638 and #7592. PR-URL: #9178 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX)Affected core subsystem(s)
deps V8
Description of change
Float the following patch:
InstanceOfStub incorrectly interprets the hole as a prototype.
https://codereview.chromium.org/1810953002/
Fixes: #7592
/cc @bnoordhuis