RFR: 8346916: [REDO] align_up has potential overflow [v2]

Kim Barrett kbarrett at openjdk.org
Tue Mar 4 09:36:56 UTC 2025


On Fri, 28 Feb 2025 11:37:12 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   reverted gcarguments and updated test
>
> src/hotspot/share/cds/metaspaceShared.cpp line 244:
> 
>> 242: 
>> 243:   char* aligned_base = align_up_or_null(specified_base, alignment);
>> 244:   assert(is_aligned(aligned_base, alignment), "sanity");
> 
> I don't think this assert adds anything.

Actually, it's worse than that, since is_aligned of a null pointer is problematic.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23711#discussion_r1979006881


More information about the hotspot-dev mailing list