RFR: 8347758: modules.cpp leaks string returned from get_numbered_property_as_sorted_string() [v4]

David Holmes dholmes at openjdk.org
Thu Jan 16 01:07:48 UTC 2025


On Wed, 15 Jan 2025 22:22:22 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Assertion in wrong place
>
> src/hotspot/share/classfile/modules.cpp line 639:
> 
>> 637: 
>> 638: const char* Modules::get_native_access_flags_as_sorted_string() {
>> 639:   assert(Thread::current()->current_resource_mark() != nullptr, "Setup by caller");
> 
> I think these asserts are redundant. st.as_string() will fail if there are no resource marks. We have plenty of functions that return a resurce-allocated object and it's uncommon to add such asserts.

Agreed. We detect missing ResourceMarks so there is no need to check for present ones.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23121#discussion_r1917527788


More information about the hotspot-runtime-dev mailing list