Skip to content
Permalink
Browse files
8269882: stack-use-after-scope in NewObjectA
Backport-of: 20eba35515073c4daf1fa8ac78a37196ea196690
  • Loading branch information
RealCLanger committed Jul 23, 2021
1 parent c6812be commit de786bbcc1aaabfececadb16cda0814c6c61df42
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/hotspot/share/prims/jni.cpp
@@ -977,7 +977,7 @@ JNI_ENTRY(jobject, jni_NewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID,
HOTSPOT_JNI_NEWOBJECTA_ENTRY(env, clazz, (uintptr_t) methodID);

jobject obj = NULL;
DT_RETURN_MARK(NewObjectA, jobject, (const jobject)obj);
DT_RETURN_MARK(NewObjectA, jobject, (const jobject&)obj);

instanceOop i = InstanceKlass::allocate_instance(JNIHandles::resolve_non_null(clazz), CHECK_NULL);
obj = JNIHandles::make_local(THREAD, i);

1 comment on commit de786bb

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on de786bb Jul 23, 2021

Please sign in to comment.