RFR: 8283013: Simplify Arguments::parse_argument() [v3]

Ioi Lam iklam at openjdk.java.net
Wed Mar 30 20:39:19 UTC 2022


On Wed, 30 Mar 2022 15:47:23 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   moved comment
>
> src/hotspot/share/runtime/arguments.cpp line 1069:
> 
>> 1067: 
>> 1068:   size_t name_len = size_t(arg - name);
>> 1069:   JVMFlag* flag = find_jvm_flag(name, name_len);
> 
> Consider -XX:@blah
> I think the name_len could be 0 if the preceding while loop did not increment the arg pointer.
> But I think it is ok because find_jvm_flag would return NULL on a zero name_len.
> Is it correct?

The code does handle the case where `name_len==0`, but I added a new check anyway to make the code easier to understand.

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

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


More information about the hotspot-dev mailing list