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

deps: cherry-pick 09de996 from V8 upstream #11905

Closed
wants to merge 1 commit into from

Conversation

fhinkel
Copy link
Member

@fhinkel fhinkel commented Mar 17, 2017

Original commit message:

[debugger] fix switch block source positions.

The switch statement itself is part of the switch block.
However, the source position of the statement is outside of
the block. This leads to confusion for the debugger, if the
switch block pushes a block context: the current context is
a block context, but the scope analysis based on the current
source position tells the debugger that we should be outside
the scope, so we should have the function context.

R=marja@chromium.org
BUG=v8:6085
Review-Url: https://codereview.chromium.org/2744213003
Cr-Commit-Position: refs/heads/master@{#43744}
Committed: https://chromium.googlesource.com/v8/v8/+/09de9969ccb9bc3bbd667788afad665b309d02f5

Fixes: #11746

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

deps, v8

/cc @nodejs/v8

The test in #11746
does not crash with this fix anymore. But since it's a V8 fix, I think we don't need an extra regression test here.

@nodejs-github-bot nodejs-github-bot added the v8 engine Issues and PRs related to the V8 dependency. label Mar 17, 2017
@ofrobots
Copy link
Contributor

@fhinkel @hashseed can this be backported to 5.7? Is the bug relevant to 5.1 and 4.5?

@hashseed
Copy link
Member

I merged this upstream to 5.7 already. There is also another fix that I merged with it, which fixes a similar problem.

@fhinkel
Copy link
Member Author

fhinkel commented Mar 17, 2017

The bug doesn't occur in Node v6. It does occur in Node v7 (V8 5.4). If the patch applies cleanly we should backport to v7.

Copy link
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once you include a bump to V8 version.

Original commit message:
  [debugger] fix switch block source positions.

  The switch statement itself is part of the switch block.
  However, the source position of the statement is outside of
  the block. This leads to confusion for the debugger, if the
  switch block pushes a block context: the current context is
  a block context, but the scope analysis based on the current
  source position tells the debugger that we should be outside
  the scope, so we should have the function context.

  R=marja@chromium.org
  BUG=v8:6085
  Review-Url: https://codereview.chromium.org/2744213003
  Cr-Commit-Position: refs/heads/master@{nodejs#43744}
  Committed: https://chromium.googlesource.com/v8/v8/+/09de9969ccb9bc3bbd667788afad665b309d02f5

Fixes: nodejs#11746
@fhinkel
Copy link
Member Author

fhinkel commented Mar 17, 2017

Good catch, thanks! Bumped the version.

@fhinkel
Copy link
Member Author

fhinkel commented Mar 19, 2017

@fhinkel
Copy link
Member Author

fhinkel commented Mar 19, 2017

Landed in dd8982d

@fhinkel fhinkel closed this Mar 19, 2017
fhinkel added a commit that referenced this pull request Mar 19, 2017
Original commit message:
  [debugger] fix switch block source positions.

  The switch statement itself is part of the switch block.
  However, the source position of the statement is outside of
  the block. This leads to confusion for the debugger, if the
  switch block pushes a block context: the current context is
  a block context, but the scope analysis based on the current
  source position tells the debugger that we should be outside
  the scope, so we should have the function context.

  R=marja@chromium.org
  BUG=v8:6085
  Review-Url: https://codereview.chromium.org/2744213003
  Cr-Commit-Position: refs/heads/master@{#43744}
  Committed: https://chromium.googlesource.com/v8/v8/+/09de9969ccb9bc3bbd667788afad665b309d02f5

Fixes: #11746
PR-URL: #11905
Fixes: #11746
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
jungx098 pushed a commit to jungx098/node that referenced this pull request Mar 21, 2017
Original commit message:
  [debugger] fix switch block source positions.

  The switch statement itself is part of the switch block.
  However, the source position of the statement is outside of
  the block. This leads to confusion for the debugger, if the
  switch block pushes a block context: the current context is
  a block context, but the scope analysis based on the current
  source position tells the debugger that we should be outside
  the scope, so we should have the function context.

  R=marja@chromium.org
  BUG=v8:6085
  Review-Url: https://codereview.chromium.org/2744213003
  Cr-Commit-Position: refs/heads/master@{nodejs#43744}
  Committed: https://chromium.googlesource.com/v8/v8/+/09de9969ccb9bc3bbd667788afad665b309d02f5

Fixes: nodejs#11746
PR-URL: nodejs#11905
Fixes: nodejs#11746
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
@italoacasas
Copy link
Contributor

italoacasas commented Mar 21, 2017

This is not landing clearly in v7, git conflicts.

@fhinkel be aware, the V8 version in Node 7 is 5.5 not 5.4.

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

Successfully merging this pull request may close these issues.

Use of variables + for loop + switch in a generator function causes inspector to crash
7 participants