diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-03 11:02:38 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-03 12:36:38 +0100 |
commit | 3dcd58cd54a922b864494fb7fff4a7f7a8562db9 (patch) | |
tree | 1e7b416de3dd46b0301f835632f8b3d0392beb97 /compiler/optimizing/bounds_check_elimination.cc | |
parent | d43f160dc294655885a2c273307d34585c4ce97b (diff) | |
download | art-3dcd58cd54a922b864494fb7fff4a7f7a8562db9.zip art-3dcd58cd54a922b864494fb7fff4a7f7a8562db9.tar.gz art-3dcd58cd54a922b864494fb7fff4a7f7a8562db9.tar.bz2 |
Fix a bug when creating a HDeoptimization instruction.
We need to copy the environment, instead of just pointing
to an existing one. Otherwise, if the instruction that initially
holds the environemnt gets removed from the graph, any update
to an instruction in that environment will not be reflected in it.
bug:20058506
Change-Id: I2a62476d0851ecbc3707c0da395d8502ee437422
Diffstat (limited to 'compiler/optimizing/bounds_check_elimination.cc')
-rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index 01f7e91..dce02f7 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -1011,7 +1011,7 @@ class BCEVisitor : public HGraphVisitor { HDeoptimize(cond, bounds_check->GetDexPc()); block->InsertInstructionBefore(cond, bounds_check); block->InsertInstructionBefore(deoptimize, bounds_check); - deoptimize->SetEnvironment(bounds_check->GetEnvironment()); + deoptimize->CopyEnvironmentFrom(bounds_check->GetEnvironment()); } void AddComparesWithDeoptimization(HBasicBlock* block) { |