RFR: 8282773: Refactor parsing of integer VM options [v4]
Ioi Lam
iklam at openjdk.java.net
Mon Mar 14 05:09:30 UTC 2022
On Mon, 14 Mar 2022 04:40:24 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added all edge cases for k/m/g/t suffixes
>
> src/hotspot/share/runtime/arguments.cpp line 770:
>
>> 768: unsigned long v = strtoul(s, endptr, base);
>> 769: if (errno != 0 LP64_ONLY(|| v > max_juint)) {
>> 770: // unsigned long is 64-bit on LP64, so we need explicit range check.
>
> Same issue here about Windows `long` being 32 bits.
Hi Kim, thanks for the comments. I have reverted the code to use strtoll/strtoull as in 2a5e3e6df3e61b15126ca0582aada57955a25a07, and updated the comments to explain why.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7763
More information about the hotspot-runtime-dev
mailing list