Index: runtime/vm/constant_propagator.cc |
diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc |
index f3827b0ee97043226e98e417ad52aa088f71ceb5..9d2bc110cd2248641c859880cdb5f7b90d4f253d 100644 |
--- a/runtime/vm/constant_propagator.cc |
+++ b/runtime/vm/constant_propagator.cc |
@@ -755,7 +755,7 @@ void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) { |
((rep == kUnboxedDouble) && (value_cid == kDoubleCid)) || |
((rep == kUnboxedMint) && (value_cid == kMintCid))); |
// The representation guarantees the type check to be true. |
- SetValue(instr, Bool::True()); |
+ SetValue(instr, instr->negate_result() ? Bool::False() : Bool::True()); |
} else { |
SetValue(instr, non_constant_); |
} |
@@ -770,7 +770,8 @@ void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) { |
checked_type, checked_type_arguments, &bound_error); |
// Can only have bound error with generics. |
ASSERT(bound_error.IsNull()); |
- SetValue(instr, Bool::Get(is_instance)); |
+ SetValue(instr, Bool::Get(instr->negate_result() ? !is_instance |
+ : is_instance)); |
return; |
} |
} |