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

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


On Wed, 10 Nov 2021 06:14:18 GMT, Dean Long <dlong at openjdk.org> wrote:

> > That could work. Do you think it is better to split this into two or three RFEs:
> 
> I would be in favor of that, if it's ok with @vnkozlov

Yes, I agree with that. Make small patch to backport it. And do refactoring separately only in latest JDK.

> 
> > Do you think it is feasible to replace all the NULL and 0 with LIR_Opr::illegalOpr()?
> 
> I don't think so, if we want to preserve existing behavior. NULL and illegalOpr() were two different values before, and now LIR_Opr() introduces a new value that is different from both NULL and illegalOpr(), and with the value 0 I believe it becomes a valid pointer LIR_Opt. To preserve exisiting behavior, we should crash if any attempt is made to use a NULL LIR_Opr. illegalOpr() doesn't do that. We could change existing behavior rather than preserve it, but then each use of NULL would need to be examined on a case-by-case basis.

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

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


More information about the hotspot-compiler-dev mailing list