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

Unified Diff: runtime/vm/constant_propagator.cc

Issue 1380203004: VM: Fix crash bug in constant propagation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/constant_propagator.cc
diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc
index 37e81b605e6bafcae6e9a4be332a3a62eb222eaa..6ccc307e2ee532ea554ffcf4ba4920feea067d42 100644
--- a/runtime/vm/constant_propagator.cc
+++ b/runtime/vm/constant_propagator.cc
@@ -1020,7 +1020,7 @@ void ConstantPropagator::VisitSmiToDouble(SmiToDoubleInstr* instr) {
if (IsConstant(value) && value.IsInteger()) {
SetValue(instr, Double::Handle(I,
Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
- } else if (IsNonConstant(value)) {
+ } else if (!IsUnknown(value)) {
SetValue(instr, non_constant_);
}
}
@@ -1031,7 +1031,7 @@ void ConstantPropagator::VisitMintToDouble(MintToDoubleInstr* instr) {
if (IsConstant(value) && value.IsInteger()) {
SetValue(instr, Double::Handle(I,
Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
- } else if (IsNonConstant(value)) {
+ } else if (!IsUnknown(value)) {
SetValue(instr, non_constant_);
}
}
@@ -1042,7 +1042,7 @@ void ConstantPropagator::VisitInt32ToDouble(Int32ToDoubleInstr* instr) {
if (IsConstant(value) && value.IsInteger()) {
SetValue(instr, Double::Handle(I,
Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
- } else if (IsNonConstant(value)) {
+ } else if (!IsUnknown(value)) {
SetValue(instr, non_constant_);
}
}
« no previous file with comments | « no previous file | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698