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

Dean Long dlong at openjdk.java.net
Thu Nov 11 04:27:39 UTC 2021


On Thu, 11 Nov 2021 01:57:58 GMT, Man Cao <manc at openjdk.org> wrote:

>> Hi all,
>> 
>> Could anyone provide some feedback on this bug fix and refactoring change? See https://bugs.openjdk.java.net/browse/JDK-8276453 for more details.
>> If the direction of this change looks good, we can proceed removing the "UGLY HACK" in c1_LIR.hpp and refactor occurrences of "opr->fn()" to "opr.fn()".
>
> 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

I think we want any operation on LIR_Opr() or nullOpr() to fail, except ==, !=, and is_equal(), so I think 0 is a poor choice:

   LIR_Opr() : _value(0) {}

because it would seem to allow calls like opr->nullOpr()->pointer() to succeed.  Your suggestion to use illegalOpr() instead is probably going to end up being the best choice after all.

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

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


More information about the hotspot-compiler-dev mailing list