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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10452029: Fix bug when a variable is used in try/catch and accessed trough HFieldGet and HFieldSet: reference… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/codegen.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen.dart (revision 7979)
+++ lib/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1568,7 +1568,7 @@
}
visitFieldGet(HFieldGet node) {
- if (node.receiver !== null) {
+ if (!node.isFromActivation()) {
String name =
compiler.namer.instanceFieldName(currentLibrary, node.name);
beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
@@ -1577,13 +1577,14 @@
buffer.add(name);
beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
} else {
- buffer.add(JsNames.getValid(node.name.slowToString()));
+ String name = temporary(node.receiver);
+ buffer.add(name);
}
}
visitFieldSet(HFieldSet node) {
String name;
- if (node.receiver !== null) {
+ if (!node.isFromActivation()) {
name =
compiler.namer.instanceFieldName(currentLibrary, node.name);
beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE);
@@ -1593,7 +1594,7 @@
} else {
// TODO(ngeoffray): Remove the 'var' once we don't globally box
// variables used in a try/catch.
- name = JsNames.getValid(node.name.slowToString());
+ String name = temporary(node.receiver);
declareVariable(name);
}
buffer.add(' = ');

Powered by Google App Engine
This is Rietveld 408576698