OSDN Git Service

Fix inliner bug for empty callees.
authorBen Cheng <bccheng@android.com>
Sat, 11 Sep 2010 00:11:11 +0000 (17:11 -0700)
committerBen Cheng <bccheng@google.com>
Sat, 11 Sep 2010 00:15:37 +0000 (17:15 -0700)
Add an explicit branch to continue from the next instruction.

Bug: 2992514

(cherry-picked from dalvik-dev)

Change-Id: I6e036e330255e7cd9d1504c50c4260910c38dfff

vm/compiler/InlineTransformation.c

index 9559f5d..ce45b8b 100644 (file)
@@ -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;
     }