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

Issue 1569523002: Fix VM bug with try-catch inside of try-finally. (Closed)

Created:
4 years, 11 months ago by Florian Schneider
Modified:
4 years, 11 months ago
Reviewers:
hausner, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix VM bug with try-catch inside of try-finally. There were two exception handlers with the same index added to the code so that only the one added last was executed. In case of an exception that means that a re-throw may be omitted, causing invalid control flow. Also, add assertion to ensure unique try-index for exception handlers. BUG=#25333 R=hausner@google.com Committed: https://github.com/dart-lang/sdk/commit/e9968ca5ff695d4b88e924ddac3302c8ddbe6746

Patch Set 1 #

Patch Set 2 : added regression test #

Total comments: 6

Patch Set 3 : addressed comment #

Patch Set 4 : added comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -9 lines) Patch
M runtime/vm/ast.h View 3 chunks +7 lines, -2 lines 0 comments Download
M runtime/vm/code_descriptors.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/parser.cc View 1 2 3 6 chunks +24 lines, -4 lines 0 comments Download
A tests/language/try_finally_regress_25333_test.dart View 1 2 1 chunk +65 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Florian Schneider
4 years, 11 months ago (2016-01-06 16:21:52 UTC) #2
Ivan Posva
DBC -ip https://codereview.chromium.org/1569523002/diff/20001/tests/language/try_finally_regress_25333_test.dart File tests/language/try_finally_regress_25333_test.dart (right): https://codereview.chromium.org/1569523002/diff/20001/tests/language/try_finally_regress_25333_test.dart#newcode18 tests/language/try_finally_regress_25333_test.dart:18: } Please add some state verifying that ...
4 years, 11 months ago (2016-01-06 16:35:47 UTC) #4
Florian Schneider
https://codereview.chromium.org/1569523002/diff/20001/tests/language/try_finally_regress_25333_test.dart File tests/language/try_finally_regress_25333_test.dart (right): https://codereview.chromium.org/1569523002/diff/20001/tests/language/try_finally_regress_25333_test.dart#newcode18 tests/language/try_finally_regress_25333_test.dart:18: } On 2016/01/06 16:35:47, Ivan Posva wrote: > Please ...
4 years, 11 months ago (2016-01-06 16:40:07 UTC) #5
hausner
LGTM but I don't understand why the new rethrow_clause ast is necessary. It seems to ...
4 years, 11 months ago (2016-01-06 17:11:59 UTC) #6
Florian Schneider
I'll add the comment to the code as well. https://codereview.chromium.org/1569523002/diff/20001/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1569523002/diff/20001/runtime/vm/parser.cc#newcode9804 runtime/vm/parser.cc:9804: ...
4 years, 11 months ago (2016-01-06 17:37:26 UTC) #7
Florian Schneider
I should add: The flowgraph builder emits two copies of a finally-block if the try-block ...
4 years, 11 months ago (2016-01-06 17:42:00 UTC) #8
hausner
Thank you for the explanation. It would be good to have it in the code ...
4 years, 11 months ago (2016-01-06 17:44:32 UTC) #9
Florian Schneider
4 years, 11 months ago (2016-01-06 17:50:59 UTC) #11
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
e9968ca5ff695d4b88e924ddac3302c8ddbe6746 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698