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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 13723002: dart2js: Fix SSA corner case with always breaking loop and failing assert (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index e6cfe3cd82b92d74668a8666a8cbe2109179a262..c1b9796ec9cbe58f70e8ea5889df11e536d25935 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -544,6 +544,8 @@ class HBasicBlock extends HInstructionList {
}
void addPhi(HPhi phi) {
+ assert(phi.inputs.length == 0 || phi.inputs.length == predecessors.length);
+ assert(phi.block == null);
phis.internalAddAfter(phis.last, phi);
phi.notifyAddedToBlock(this);
}
@@ -1931,6 +1933,7 @@ class HPhi extends HInstruction {
void addInput(HInstruction input) {
assert(isInBasicBlock());
inputs.add(input);
+ assert(inputs.length <= block.predecessors.length);
input.usedBy.add(this);
}

Powered by Google App Engine
This is Rietveld 408576698