RFR: 8331731: ubsan: relocInfo.cpp:155:30: runtime error: applying non-zero offset 18446744073709551614 to null pointer

Vladimir Kozlov kvn at openjdk.org
Tue May 28 16:49:01 UTC 2024


On Tue, 28 May 2024 14:16:59 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> > Doesn't look very nice, but should work.
> 
> I agree, it does not look very nice. Not sure what is better, disabling ubsan for the methods or use the code you suggested. Or maybe add some helper template/macro for pointer additions that covers those cases and handles nullptr nicely ?

I prefer @TheRealMDoerr suggestion vs disabling ubsan check for this code.  It should be compiled to the same assembler.
I would only add comment to explain why we don't do simple pointer arithmetic here.

`cs->locs_start()` == `nullptr` is common case and I don't want to complicate code with additional `nullptr` checks.

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

PR Comment: https://git.openjdk.org/jdk/pull/19424#issuecomment-2135703084


More information about the hotspot-compiler-dev mailing list