Fix various bugs found when debugger is attached to the VM.
See b/2161257 for details.
diff --git a/vm/compiler/Frontend.c b/vm/compiler/Frontend.c
index b224614..163cdf8 100644
--- a/vm/compiler/Frontend.c
+++ b/vm/compiler/Frontend.c
@@ -47,6 +47,8 @@
return insnWidth;
}
+#define UNKNOWN_TARGET 0xffffffff
+
/*
* Identify block-ending instructions and collect supplemental information
* regarding the following instructions.
@@ -63,6 +65,8 @@
case OP_RETURN_WIDE:
case OP_RETURN_OBJECT:
case OP_THROW:
+ *target = UNKNOWN_TARGET;
+ break;
case OP_INVOKE_VIRTUAL:
case OP_INVOKE_VIRTUAL_RANGE:
case OP_INVOKE_INTERFACE:
@@ -146,7 +150,8 @@
default:
return false;
- } return true;
+ }
+ return true;
}
/*
@@ -524,7 +529,8 @@
/* Target block not included in the trace */
if (curBB->taken == NULL &&
- (isInvoke || (targetOffset != curOffset))) {
+ (isInvoke || (targetOffset != UNKNOWN_TARGET &&
+ targetOffset != curOffset))) {
BasicBlock *newBB;
if (isInvoke) {
/* Monomorphic callee */