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

Issue 1006463003: Fix restoring of contexts in inlined finally code (Closed)

Created:
5 years, 9 months ago by hausner
Modified:
5 years, 9 months ago
Reviewers:
regis, srdjan, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, regis, Florian Schneider
Visibility:
Public.

Description

Fix restoring of contexts in inlined finally code When inlining code from a finally block before return or jump instructions, do not restore the saved_try_context since the inlined code is running in the context of the return or jump instruction. This is an old bug that surfaced in async code, since async code deals with captured variables (contexts) much more than regular code. R=srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=44465

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -5 lines) Patch
M runtime/vm/flow_graph_builder.cc View 1 2 1 chunk +4 lines, -1 line 1 comment Download
M tests/language/language.status View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
A tests/language/regress_22822_test.dart View 1 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
hausner
5 years, 9 months ago (2015-03-12 20:48:38 UTC) #2
srdjan
LGTM https://codereview.chromium.org/1006463003/diff/20001/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/1006463003/diff/20001/runtime/vm/flow_graph_builder.cc#newcode4295 runtime/vm/flow_graph_builder.cc:4295: Add a comment, similar to the on in ...
5 years, 9 months ago (2015-03-12 22:09:22 UTC) #3
hausner
Committed patchset #3 (id:40001) manually as r44465 (presubmit successful).
5 years, 9 months ago (2015-03-13 15:53:18 UTC) #4
regis
5 years, 9 months ago (2015-03-16 22:26:14 UTC) #6
Message was sent while issue was closed.
DBC

https://codereview.chromium.org/1006463003/diff/40001/runtime/vm/flow_graph_b...
File runtime/vm/flow_graph_builder.cc (right):

https://codereview.chromium.org/1006463003/diff/40001/runtime/vm/flow_graph_b...
runtime/vm/flow_graph_builder.cc:4298: // that follows the inlined code. See
issue 22822.
at he -> at the

I find the comment implying a context mismatch somewhat misleading. The reason
we do not need to restore the context is that an inlined finally is never used
as an exception handler, therefore the context is always already set on entry.
In other words, the inlined finally block is never the target of a long jump
that would find an uninitialized current context variable.

Powered by Google App Engine
This is Rietveld 408576698