Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Issue 10665009: Fix parent function of deeply nested closures (Closed)

Created:
8 years, 6 months ago by hausner
Modified:
8 years, 6 months ago
Reviewers:
regis
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix parent function of deeply nested closures We got the parent of nested closures wrong if the nesting level was > 2. Fix for issue 3412. Committed: https://code.google.com/p/dart/source/detail?r=9065

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -15 lines) Patch
M runtime/vm/debugger.cc View 1 2 chunks +4 lines, -5 lines 0 comments Download
M runtime/vm/parser.h View 3 chunks +15 lines, -6 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 7 chunks +18 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hausner
8 years, 6 months ago (2012-06-22 23:50:15 UTC) #1
regis
LGTM with one bug to fix. http://codereview.chromium.org/10665009/diff/2002/runtime/vm/parser.cc File runtime/vm/parser.cc (right): http://codereview.chromium.org/10665009/diff/2002/runtime/vm/parser.cc#newcode2085 runtime/vm/parser.cc:2085: innermost_function_ = func.raw(); ...
8 years, 6 months ago (2012-06-22 23:58:32 UTC) #2
hausner
8 years, 6 months ago (2012-06-23 00:15:04 UTC) #3
http://codereview.chromium.org/10665009/diff/2002/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

http://codereview.chromium.org/10665009/diff/2002/runtime/vm/parser.cc#newcod...
runtime/vm/parser.cc:2085: innermost_function_ = func.raw();
On 2012/06/22 23:58:32, regis wrote:
> You should assert that func.parent() == innermost_function_
> Then, you need to reset innermost_function_ to func.parent() on exit of
> ParseFunc.

Good catch!

Actually, I initialize innermost_func_ to be the same as current_function_ in
the constructor, so this assertion does not necessarily hold. I am now saving
and restoring the current_function_ in a local variable.

Powered by Google App Engine
This is Rietveld 408576698