Don't do a recursive call when there are CHA guards.
Otherwise we would continue execute the method with invalid inlining
optimizations.
Test: 832-cha-recursive
Bug: 19381779
Change-Id: I57d73828d2a9c30f429cf32906f94244346c1310
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 4830d65..2549546 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -4639,6 +4639,7 @@
switch (invoke->GetCodePtrLocation()) {
case CodePtrLocation::kCallSelf:
{
+ DCHECK(!GetGraph()->HasShouldDeoptimizeFlag());
// Use a scope to help guarantee that `RecordPcInfo()` records the correct pc.
ExactAssemblyScope eas(GetVIXLAssembler(),
kInstructionSize,