Skip to content
Browse files
8269882: stack-use-after-scope in NewObjectA
Reviewed-by: kbarrett
  • Loading branch information
David Holmes committed Jul 6, 2021
1 parent df0e11b commit 20eba35515073c4daf1fa8ac78a37196ea196690
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/hotspot/share/prims/jni.cpp
@@ -976,7 +976,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);

3 comments on commit 20eba35


This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot replied Jul 6, 2021


This comment has been minimized.

Copy link

@RealCLanger RealCLanger replied Jul 13, 2021

/backport jdk17u


This comment has been minimized.

Copy link

@openjdk openjdk bot replied Jul 13, 2021

@RealCLanger the backport was successfully created on the branch RealCLanger-backport-20eba355 in my personal fork of openjdk/jdk17u. To create a pull request with this backport targeting openjdk/jdk17u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 20eba355 from the openjdk/jdk repository.

The commit being backported was authored by David Holmes on 6 Jul 2021 and was reviewed by Kim Barrett.


If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u:

$ git fetch RealCLanger-backport-20eba355:RealCLanger-backport-20eba355
$ git checkout RealCLanger-backport-20eba355
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push RealCLanger-backport-20eba355
Please sign in to comment.