From 639ef500790cc314b8572ecde2284faf81f62c97 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 25 Mar 2011 18:54:09 -0600 Subject: [PATCH] handle null caller in JVM_GetCallerClass --- src/classpath-openjdk.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 6387cafe5b..7df324fb12 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -3223,8 +3223,10 @@ EXPORT(JVM_GetCallerClass)(Thread* t, int target) { ENTER(t, Thread::ActiveState); - return makeLocalReference - (t, getJClass(t, methodClass(t, getCaller(t, target)))); + object method = getCaller(t, target); + + return method ? makeLocalReference + (t, getJClass(t, methodClass(t, method))) : 0; } extern "C" JNIEXPORT jclass JNICALL