On Wed, 7 Dec 2022 16:00:04 GMT, Laurent Bourgès <[email protected]> wrote:

>> src/hotspot/os/bsd/attachListener_bsd.cpp line 260:
>> 
>>> 258:   // name ("load", "datadump", ...), and <arg> is an argument
>>> 259:   int expected_str_count = 2 + AttachOperation::arg_count_max;
>>> 260:   const int max_len = (ver_str_len + 1) + 
>>> (AttachOperation::name_length_max + 1) +
>> 
>> This makes `max_len` a runtime variable, before it was a compile time 
>> constant. Below, we use it to create the buf array. IIRC creating an array 
>> with a variable runtime length is a non-standard compiler extension. I am 
>> surprised this even builds.
>
> better to keep sizeof(ver_str) here (const)

Updated to use sizeof.

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

PR: https://git.openjdk.org/jdk/pull/11115

Reply via email to