diff options
| author | Bill Buzbee <buzbee@google.com> | 2010-01-27 15:43:08 -0800 |
|---|---|---|
| committer | Bill Buzbee <buzbee@google.com> | 2010-01-27 15:43:08 -0800 |
| commit | 480e67866a50c64cecfdd7bdc4aeafe41e12b2b0 (patch) | |
| tree | 5d2c6422bc395fbfe305121baa838c3cc5878c39 /vm/compiler/codegen/arm/CodegenDriver.c | |
| parent | 17c4196ef6904c7770455ff68f3b54e3dfbc6ad7 (diff) | |
Jit: Fix INSTANCE_OF corner case.
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
| -rw-r--r-- | vm/compiler/codegen/arm/CodegenDriver.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c index 1993c9dae..886110280 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.c +++ b/vm/compiler/codegen/arm/CodegenDriver.c @@ -2454,7 +2454,19 @@ static bool handleFmt22c(CompilationUnit *cUnit, MIR *mir) RegLocation rlResult; ClassObject *classPtr = (cUnit->method->clazz->pDvmDex->pResClasses[mir->dalvikInsn.vC]); - assert(classPtr != NULL); + /* + * Note: It is possible that classPtr is NULL at this point, + * even though this instruction has been successfully interpreted. + * If the previous interpretation had a null source, the + * interpreter would not have bothered to resolve the clazz. + * Bail out to the interpreter in this case, and log it + * so that we can tell if it happens frequently. + */ + if (classPtr == NULL) { + LOGD("null clazz in OP_INSTANCE_OF, single-stepping"); + genInterpSingleStep(cUnit, mir); + break; + } flushAllRegs(cUnit); /* Send everything to home location */ loadValueDirectFixed(cUnit, rlSrc, r0); /* Ref */ loadConstant(cUnit, r2, (int) classPtr ); |
