RFR: 8356865: C2: Unreasonable values for debug flag FastAllocateSizeLimit can lead to left-shift-overflow, which is UB [v4]

duke duke at openjdk.org
Mon Jun 23 07:40:32 UTC 2025


On Mon, 23 Jun 2025 07:09:15 GMT, Benoît Maillard <bmaillard at openjdk.org> wrote:

>> This PR adds a range constraint for the `-XX:FastAllocateSizeLimit` debug flag. This prevents undefined behavior caused by left-shift overflow of the flag value in `GraphKit::new_array`.
>> 
>> ### Testing
>> - [x] [GitHub Actions](https://github.com/benoitmaillard/jdk/actions?query=branch%3AJDK-8356865)
>> - [x] tier1-3, plus some internal testing
>> - [x] Manual testing with values known to previously cause undefined behavior
>> 
>> Thanks!
>
> Benoît Maillard has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8356865: Add comment for range in test

@benoitmaillard 
Your change (at version 8241b2188b2f8334439f3824fb535ce29091eb37) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jdk/pull/25834#issuecomment-2995283731


More information about the hotspot-dev mailing list