mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-17 05:45:05 +00:00
8286331: jni_GetStringUTFChars() uses wrong heap allocator
Reviewed-by: dlong, stuefe
This commit is contained in:
parent
902b1dd455
commit
b0d2b0a355
@ -2233,7 +2233,7 @@ JNI_ENTRY(const char*, jni_GetStringUTFChars(JNIEnv *env, jstring string, jboole
|
||||
if (s_value != NULL) {
|
||||
size_t length = java_lang_String::utf8_length(java_string, s_value);
|
||||
/* JNI Specification states return NULL on OOM */
|
||||
result = AllocateHeap(length + 1, mtInternal, 0, AllocFailStrategy::RETURN_NULL);
|
||||
result = AllocateHeap(length + 1, mtInternal, AllocFailStrategy::RETURN_NULL);
|
||||
if (result != NULL) {
|
||||
java_lang_String::as_utf8_string(java_string, s_value, result, (int) length + 1);
|
||||
if (isCopy != NULL) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,7 +64,7 @@ public:
|
||||
memset(_stack, 0, sizeof(_stack));
|
||||
}
|
||||
|
||||
NativeCallStack(int toSkip);
|
||||
explicit NativeCallStack(int toSkip);
|
||||
NativeCallStack(address* pc, int frameCount);
|
||||
|
||||
static inline const NativeCallStack& empty_stack() { return _empty_stack; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user