Skip to content

Commit 5014504

Browse files
jyma22Paul Hohensee
authored andcommitted
8283784: java_lang_String::as_platform_dependent_str stores to oop in native state
Backport-of: c9a469a4591002e7f51317a8494a2df902db5bfa
1 parent b6eb8ce commit 5014504

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/hotspot/share/classfile/javaClasses.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,18 @@ char* java_lang_String::as_platform_dependent_str(Handle java_string, TRAPS) {
456456
}
457457

458458
char *native_platform_string;
459-
{ JavaThread* thread = THREAD;
460-
jstring js = (jstring) JNIHandles::make_local(thread, java_string());
461-
bool is_copy;
459+
JavaThread* thread = THREAD;
460+
jstring js = (jstring) JNIHandles::make_local(thread, java_string());
461+
{
462462
HandleMark hm(thread);
463463
ThreadToNativeFromVM ttn(thread);
464464
JNIEnv *env = thread->jni_environment();
465+
bool is_copy;
465466
native_platform_string = (_to_platform_string_fn)(env, js, &is_copy);
466467
assert(is_copy == JNI_TRUE, "is_copy value changed");
467-
JNIHandles::destroy_local(js);
468468
}
469+
JNIHandles::destroy_local(js);
470+
469471
return native_platform_string;
470472
}
471473

0 commit comments

Comments
 (0)