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

Issue 10452029: Fix bug when a variable is used in try/catch and accessed trough HFieldGet and HFieldSet: reference… (Closed)

Created:
8 years, 7 months ago by ngeoffray
Modified:
8 years, 7 months ago
CC:
reviews_dartlang.org, ahe, floitsch, karlklose
Visibility:
Public.

Description

Fix bug when a variable is used in try/catch and accessed trough HFieldGet and HFieldSet: reference a new HParameterValue instead of a name. Otherwise, the name may conflict with an existing variable. Committed: https://code.google.com/p/dart/source/detail?r=7987

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -11 lines) Patch
M lib/compiler/implementation/ssa/builder.dart View 1 5 chunks +22 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 4 chunks +12 lines, -6 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 2 chunks +6 lines, -3 lines 0 comments Download
A tests/language/scoped_variables_try_catch_test.dart View 1 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ngeoffray
8 years, 7 months ago (2012-05-25 09:34:13 UTC) #1
kasperl
LGTM. I'm not sure I'm super excited about the use of the word "activation", but ...
8 years, 7 months ago (2012-05-25 10:05:15 UTC) #2
ngeoffray
8 years, 7 months ago (2012-05-25 10:45:10 UTC) #3
Thanks Kasper.

I have also changed the cl a bit to take into account a "real" parameter being
used indirectly. I will clean this up with the new liveness optimization.

https://chromiumcodereview.appspot.com/10452029/diff/2001/lib/compiler/implem...
File lib/compiler/implementation/ssa/builder.dart (right):

https://chromiumcodereview.appspot.com/10452029/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/builder.dart:415: HParameterValue parameter =
builder.activationVariables.putIfAbsent(
On 2012/05/25 10:05:15, kasperl wrote:
> This code should be refactored. There's a lot of duplication.

Done.

https://chromiumcodereview.appspot.com/10452029/diff/2001/tests/language/scop...
File tests/language/scoped_variables_try_catch_test.dart (right):

https://chromiumcodereview.appspot.com/10452029/diff/2001/tests/language/scop...
tests/language/scoped_variables_try_catch_test.dart:4: // Test that try/catch
does not shadow a variable at runtime.
On 2012/05/25 10:05:15, kasperl wrote:
> I would add a newline before the test comment. It's hard to distinguish it
from
> the copyright notice.

Done.

Powered by Google App Engine
This is Rietveld 408576698