Handle null pointer in PopLocalFrame

This commit is contained in:
Carsten Elton Sørensen 2012-12-21 09:56:21 +01:00 committed by Joel Dice
parent 887a32bc10
commit cad4719f7d

View File

@ -3370,12 +3370,21 @@ PushLocalFrame(Thread* t, jint capacity)
uint64_t
popLocalFrame(Thread* t, uintptr_t* arguments)
{
object result = *reinterpret_cast<jobject>(arguments[0]);
PROTECT(t, result);
uint64_t r;
jobject presult = reinterpret_cast<jobject>(arguments[0]);
if(presult != NULL) {
object result = *presult;
PROTECT(t, result);
t->m->processor->popLocalFrame(t);
return reinterpret_cast<uint64_t>(makeLocalReference(t, result));
t->m->processor->popLocalFrame(t);
r = reinterpret_cast<uint64_t>(makeLocalReference(t, result));
} else {
t->m->processor->popLocalFrame(t);
r = 0;
}
return r;
}
jobject JNICALL