RFR: JDK-8301074: Replace NULL with nullptr in share/opto/ [v2]

Vladimir Kozlov kvn at openjdk.org
Mon Feb 27 18:38:43 UTC 2023


On Mon, 27 Feb 2023 10:46:51 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/opto/graphKit.cpp line 522:
>> 
>>> 520:       // Cf. case Bytecodes::_athrow in parse2.cpp.
>>> 521:       uncommon_trap(reason, Deoptimization::Action_none,
>>> 522:                     (ciKlass*)nullptr, (char*)nullptr, must_throw);
>> 
>> Do we need these casts? I am still not sure when casts should be used with `nullptr`.
>
> If the function is overloaded `foo(void* x); foo(int* x);` or templated `template<typename T> foo(T* x);` then you have to cast `nullptr`. Perhaps there are more cases. In this case, `uncommon_trap` is overloaded.

Thank you for explanation.

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

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


More information about the hotspot-compiler-dev mailing list