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

Issue 10987073: Fix issue 5517 by setting the successors the right way in a try/catch. (Closed)

Created:
8 years, 2 months ago by ngeoffray
Modified:
8 years, 2 months ago
Reviewers:
Søren Gjesse, kasperl
CC:
reviews_dartlang.org, floitsch
Visibility:
Public.

Description

Fix issue 5517 by setting the successors the right way in a try/catch. Committed: https://code.google.com/p/dart/source/detail?r=12998

Patch Set 1 : #

Total comments: 13

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -27 lines) Patch
M lib/compiler/implementation/ssa/builder.dart View 1 2 chunks +50 lines, -21 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 chunk +0 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/validate.dart View 1 chunk +1 line, -1 line 0 comments Download
A tests/language/finally_test.dart View 1 1 chunk +28 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
ngeoffray
https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/nodes.dart File lib/compiler/implementation/ssa/nodes.dart (left): https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/nodes.dart#oldcode585 lib/compiler/implementation/ssa/nodes.dart:585: assert(isClosed() && (block.isNew() || block.id < id)); This assert ...
8 years, 2 months ago (2012-09-27 15:10:05 UTC) #1
Søren Gjesse
lgtm, but you better get Kaspers comments as well. https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/builder.dart File lib/compiler/implementation/ssa/builder.dart (right): https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/builder.dart#newcode3947 lib/compiler/implementation/ssa/builder.dart:3947: ...
8 years, 2 months ago (2012-09-27 15:35:28 UTC) #2
kasperl
LGTM. https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/builder.dart File lib/compiler/implementation/ssa/builder.dart (right): https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/builder.dart#newcode3816 lib/compiler/implementation/ssa/builder.dart:3816: HBasicBlock startBodyBlock; startTryBlock? endTryBlock? https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementation/ssa/builder.dart#newcode3933 lib/compiler/implementation/ssa/builder.dart:3933: enterBlock.addSuccessor(startCatchBlock); Maybe ...
8 years, 2 months ago (2012-09-28 06:20:06 UTC) #3
ngeoffray
8 years, 2 months ago (2012-09-28 08:20:51 UTC) #4
Thanks Kasper and Soren!

https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementatio...
File lib/compiler/implementation/ssa/builder.dart (right):

https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementatio...
lib/compiler/implementation/ssa/builder.dart:3816: HBasicBlock startBodyBlock;
On 2012/09/28 06:20:06, kasperl wrote:
> startTryBlock?
> endTryBlock?

Done.

https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementatio...
lib/compiler/implementation/ssa/builder.dart:3933:
enterBlock.addSuccessor(startCatchBlock);
On 2012/09/28 06:20:06, kasperl wrote:
> Maybe add a helper for adding an optional successor (adding it if it isn't
> null). Use it in these two cases.

Done.

https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementatio...
lib/compiler/implementation/ssa/builder.dart:3943: if (startCatchBlock != null)
{
On 2012/09/28 06:20:06, kasperl wrote:
> If you let the addOptionalSuccessor helper return a bool that indicates
whether
> or not you added the successor you should be able to use it here. Something
> like:
> 
>    if (!endBodyBlock.addOptionalSuccessor(startCatchBlock) &&
>        !endBodyBlock.addOptionalSuccessor(startFinallBlock)) {
>      endBodyBlock.addSuccessor(exitBlock);
>    }
> 
> Not sure it's that much better but at least it's an option.

Soren made a good point that I actually did not need the last if. I changed the
code to use a conditional expression instead.

https://codereview.chromium.org/10987073/diff/2001/lib/compiler/implementatio...
lib/compiler/implementation/ssa/builder.dart:3947: } else {
On 2012/09/27 15:35:28, Søren Gjesse wrote:
> Do you ever get here? You will always have at least catch or finally.

Good catch. Done.

https://codereview.chromium.org/10987073/diff/2001/tests/language/finally_tes...
File tests/language/finally_test.dart (right):

https://codereview.chromium.org/10987073/diff/2001/tests/language/finally_tes...
tests/language/finally_test.dart:3: // BSD-style license that can be found in
the LICENSE file.
On 2012/09/27 15:35:28, Søren Gjesse wrote:
> This test could also be calle regress_5517_test.dart or
regress/5517_test.dart.

I don't really like giving 'regress_#' names to test, makes it impossible to
know what it is about by just looking at the name.

https://codereview.chromium.org/10987073/diff/2001/tests/language/finally_tes...
tests/language/finally_test.dart:6: // block would not be seen by the finally
block.
On 2012/09/27 15:35:28, Søren Gjesse wrote:
> Please mention the issue number if not renaming the test.

Done.

Powered by Google App Engine
This is Rietveld 408576698