RFR: 8276453: Undefined behavior in C1 LIR_OprDesc causes SEGV in fastdebug build [v6]

Vladimir Kozlov kvn at openjdk.java.net
Thu Nov 11 17:11:37 UTC 2021


On Thu, 11 Nov 2021 04:44:11 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Man Cao has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Use nullOpr() or {} instead of LIR_Opr()
>>  - Revert the renaming from LIR_OprDesc to LIR_Opr to minimize patch size
>
> Correction.  The existing NULL value had me confused, thinking it would cause a crash if we ever tried to use it.
> I see now that
> 
>     LIR_Opr() : _value(0) {}
> 
> just preserves the existing behavior, and we will never get a crash because we never dereference the pointer.
> But it does allow strange things like pointer() to return invalid memory, so again, I think it's best not to allow that.
> Do you agree, @caoman and @vnkozlov?

I am leaving final approval to @dean-long

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

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


More information about the hotspot-compiler-dev mailing list