From 23608ab40900463fc5c8461671ba3aa5d0a4260e Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Fri, 10 Sep 2010 17:11:11 -0700 Subject: [PATCH] Fix inliner bug for empty callees. Add an explicit branch to continue from the next instruction. Bug: 2992514 (cherry-picked from dalvik-dev) Change-Id: I6e036e330255e7cd9d1504c50c4260910c38dfff --- vm/compiler/InlineTransformation.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vm/compiler/InlineTransformation.c b/vm/compiler/InlineTransformation.c index 9559f5da6..ce45b8b0a 100644 --- a/vm/compiler/InlineTransformation.c +++ b/vm/compiler/InlineTransformation.c @@ -224,6 +224,11 @@ static void tryInlineSingletonCallsite(CompilationUnit *cUnit, if (methodStats->attributes & METHOD_IS_EMPTY) { /* The original invoke instruction is effectively turned into NOP */ invokeMIR->OptimizationFlags |= MIR_INLINED; + /* + * Need to insert an explicit branch to catch the falling knife (into + * the PC reconstruction or chaining cell). + */ + invokeBB->needFallThroughBranch = true; return; } -- 2.11.0