From 7d9d12acfda726bcad2bbc4f354555b3cbe3099d Mon Sep 17 00:00:00 2001 From: Adam Welc <adam.welc@oracle.com> Date: Thu, 1 Sep 2016 22:13:20 +0200 Subject: [PATCH] Minor fix to functions returning contexts. --- com.oracle.truffle.r.native/fficall/src/jni/Rembedded.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.oracle.truffle.r.native/fficall/src/jni/Rembedded.c b/com.oracle.truffle.r.native/fficall/src/jni/Rembedded.c index af38cfcc84..9cc1084873 100644 --- a/com.oracle.truffle.r.native/fficall/src/jni/Rembedded.c +++ b/com.oracle.truffle.r.native/fficall/src/jni/Rembedded.c @@ -601,16 +601,16 @@ CTXT R_getGlobalFunctionContext() { JNIEnv *jniEnv = getEnv(); jmethodID methodID = checkGetMethodID(jniEnv, CallRFFIHelperClass, "R_getGlobalFunctionContext", "()Ljava/lang/Object;", 1); CTXT result = (*jniEnv)->CallStaticObjectMethod(jniEnv, CallRFFIHelperClass, methodID); - result = checkRef(jniEnv, result); - return result == R_NilValue ? NULL : addGlobalRef(jniEnv, result, 0); + SEXP new_result = checkRef(jniEnv, result); + return new_result == R_NilValue ? NULL : addGlobalRef(jniEnv, result, 0); } CTXT R_getParentFunctionContext(CTXT c) { JNIEnv *jniEnv = getEnv(); jmethodID methodID = checkGetMethodID(jniEnv, CallRFFIHelperClass, "R_getParentFunctionContext", "(Ljava/lang/Object;)Ljava/lang/Object;", 1); CTXT result = (*jniEnv)->CallStaticObjectMethod(jniEnv, CallRFFIHelperClass, methodID, c); - result = checkRef(jniEnv, result); - return result == R_NilValue ? NULL : addGlobalRef(jniEnv, result, 0); + SEXP new_result = checkRef(jniEnv, result); + return new_result == R_NilValue ? NULL : addGlobalRef(jniEnv, result, 0); } SEXP R_getContextEnv(CTXT context) { -- GitLab