diff options
author | Vladimir Marko <vmarko@google.com> | 2021-05-21 16:36:23 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2021-05-26 19:36:28 +0000 |
commit | 32388f454e2bcda0d809c9691b011aab177b2286 (patch) | |
tree | 00c71efc58445c88c1cebb8c886d182a1f6d3fa1 /compiler/optimizing/graph_checker.cc | |
parent | 42da7e6ea4b1e03c3424ef10fa2b15266f72d894 (diff) |
dex2oat: Abort app compilation without boot image.
Also avoid crash in GraphChecker for bad instructions that
throw into catch block but do not have an environment. And
DCHECK() that java_lang_Double_doubleToRawLongBits and
java_lang_Float_floatToRawIntBits are intrinsics.
(cherry picked from commit d42902692d1fbb101a3c60ba314df69005da9c83)
Test: New test Dex2oatTest.MissingBootImageTest.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 188684102
Merged-In: I13ec2ee8a7968c0a5652aa67ec6291d07a986c80
Change-Id: I531b87c25e937f8c5f7d471cb7878e086e9662b5
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 44de54eccf..d1769cea0d 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -507,7 +507,12 @@ void GraphChecker::VisitInstruction(HInstruction* instruction) { } } - if (instruction->CanThrowIntoCatchBlock()) { + if (instruction->CanThrow() && !instruction->HasEnvironment()) { + AddError(StringPrintf("Throwing instruction %s:%d in block %d does not have an environment.", + instruction->DebugName(), + instruction->GetId(), + current_block_->GetBlockId())); + } else if (instruction->CanThrowIntoCatchBlock()) { // Find the top-level environment. This corresponds to the environment of // the catch block since we do not inline methods with try/catch. HEnvironment* environment = instruction->GetEnvironment(); |