RFR: 8283225: ClassLoader.c produces incorrect OutOfMemory Exception when length is 0 (aix) [v3]

Tyler Steele duke at openjdk.java.net
Thu Mar 17 16:53:40 UTC 2022


On Thu, 17 Mar 2022 07:46:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/java.base/share/native/libjava/ClassLoader.c line 106:
>> 
>>> 104:     // we chose the latter. (see 8283225)
>>> 105:     #ifdef _AIX
>>> 106:     body = (jbyte *)malloc(length == 0 ? 1 : length);
>> 
>> Using AIX_ONLY this can be simplified:
>> 
>> `body = (jbyte *)malloc(length AIX_ONLY( == 0 ? 1 : length));`
>
>> Using AIX_ONLY this can be simplified:
>> 
>> `body = (jbyte *)malloc(length AIX_ONLY( == 0 ? 1 : length));`
> 
> This is jdk, not hotspot. Do we have AIX_ONLY in the JDK?

As Thomas mentioned, this does not seem to work here.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7829


More information about the core-libs-dev mailing list