| Index: runtime/vm/intermediate_language.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language.cc (revision 41847)
|
| +++ runtime/vm/intermediate_language.cc (working copy)
|
| @@ -2051,8 +2051,15 @@
|
| if ((representation() == kUnboxedInt32) && !CanDeoptimize()) {
|
| converter->mark_truncating();
|
| }
|
| - flow_graph->InsertBefore(this, converter, env(), FlowGraph::kValue);
|
| - return converter;
|
| + // Only replace if the replacement has CanDeoptimize is consistent with
|
| + // the original instructions. We may have removed environments already.
|
| + // Due to the way type propagation works currently, the CompileType of the
|
| + // converter input may not be the same (more general) than the information
|
| + // about the input of this unboxing instructions.
|
| + if (CanDeoptimize() == converter->CanDeoptimize()) {
|
| + flow_graph->InsertBefore(this, converter, env(), FlowGraph::kValue);
|
| + return converter;
|
| + }
|
| }
|
| }
|
|
|
|
|