From d42902692d1fbb101a3c60ba314df69005da9c83 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 21 May 2021 16:36:23 +0100 Subject: 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. Test: New test Dex2oatTest.MissingBootImageTest. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 188684102 Change-Id: I13ec2ee8a7968c0a5652aa67ec6291d07a986c80 --- compiler/optimizing/graph_checker.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/graph_checker.cc') 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(); -- cgit v1.2.3-59-g8ed1b