| Index: runtime/vm/flow_graph_compiler.cc
|
| diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
|
| index 3a1bc7d2b88d83ef71bfedcb72f0f05ad4444b10..8367316db4b53b12f8c01aa917aaeefb295551ad 100644
|
| --- a/runtime/vm/flow_graph_compiler.cc
|
| +++ b/runtime/vm/flow_graph_compiler.cc
|
| @@ -990,12 +990,15 @@ void FlowGraphCompiler::EmitDeopt(intptr_t deopt_id,
|
| uint32_t flags) {
|
| ASSERT(is_optimizing());
|
| ASSERT(!intrinsic_mode());
|
| + // The pending deoptimization environment may be changed after this deopt is
|
| + // emitted, so we need to make a copy.
|
| + Environment* env_copy =
|
| + pending_deoptimization_env_->DeepCopy(zone());
|
| CompilerDeoptInfo* info =
|
| new(zone()) CompilerDeoptInfo(deopt_id,
|
| reason,
|
| flags,
|
| - pending_deoptimization_env_);
|
| -
|
| + env_copy);
|
| deopt_infos_.Add(info);
|
| assembler()->Deopt(0, /*is_eager =*/ 1);
|
| info->set_pc_offset(assembler()->CodeSize());
|
|
|