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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1084413003: Fix an assertion failure in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | pkg/pkg.status » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index c2941500aa2407178de9332d7b577747b9032c18..d6c47d244e5d1330448e2da32bb9745fc085247a 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -488,9 +488,15 @@ abstract class IrBuilder {
}
/// Creates a [ir.MutableVariable] for the given local.
- void makeMutableVariable(Local local) {
- mutableVariables[local] =
- new ir.MutableVariable(local.executableContext, local);
+ void makeMutableVariable(Local local, [ClosureClassMap closureMap]) {
+ ExecutableElement owner;
+ if (closureMap == null || closureMap.closureClassElement == null) {
+ owner = local.executableContext;
+ } else {
+ assert(local.executableContext == closureMap.closureElement);
+ owner = closureMap.callElement;
+ }
+ mutableVariables[local] = new ir.MutableVariable(owner, local);
}
/// Remove an [ir.MutableVariable] for a local.
@@ -1706,7 +1712,8 @@ abstract class IrBuilder {
void buildTry(
{TryStatementInfo tryStatementInfo,
SubbuildFunction buildTryBlock,
- List<CatchClauseInfo> catchClauseInfos: const <CatchClauseInfo>[]}) {
+ List<CatchClauseInfo> catchClauseInfos: const <CatchClauseInfo>[],
+ ClosureClassMap closureClassMap}) {
assert(isOpen);
// Catch handlers are in scope for their body. The CPS translation of
@@ -1748,7 +1755,7 @@ abstract class IrBuilder {
for (LocalVariableElement variable in tryStatementInfo.boxedOnEntry) {
assert(!tryCatchBuilder.isInMutableVariable(variable));
ir.Primitive value = tryCatchBuilder.buildLocalVariableGet(variable);
- tryCatchBuilder.makeMutableVariable(variable);
+ tryCatchBuilder.makeMutableVariable(variable, closureClassMap);
tryCatchBuilder.declareLocalVariable(variable, initialValue: value);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | pkg/pkg.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698