RFR: 8303082 : [AIX] Missing C++ name demangling with XLClang++ [v3]

Thomas Stuefe stuefe at openjdk.org
Thu Mar 30 14:59:34 UTC 2023


On Thu, 30 Mar 2023 10:17:36 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> Deepa Kumari has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:
>> 
>>   8303082 : [AIX] Missing C++ name demangling with XLClang++
>
> src/hotspot/os/aix/porting_aix.cpp line 242:
> 
>> 240:         int status;
>> 241:         char *demangled_name = abi::__cxa_demangle(p_name, nullptr, nullptr, &status);
>> 242:         if ((demangled_name != nullptr) && (status == 0)) {
> 
> Should the `strncpy` better depend on `status == 0` and the `free` operation on `demangled_name != nullptr`? I'm not sure about the relationship between the two checks. Maybe your version is ok, too.

https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html does not explicitly state an explicit connection between status == 0 and ptr != nullptr. Its at least a bit vague. A bad implementation could allocate the memory and then fail to demangle. So, yes, I'd tie the free to ptr!=NULL only.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12742#discussion_r1153392568


More information about the hotspot-runtime-dev mailing list