RFR: 8346971: [ubsan] psCardTable.cpp:131:24: runtime error: large index is out of bounds [v2]

Kim Barrett kbarrett at openjdk.org
Mon Jan 13 10:42:34 UTC 2025


On Mon, 13 Jan 2025 10:19:47 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/psCardTable.cpp line 129:
>> 
>>> 127:   // Avoid UB pointer operations by using integers internally.
>>> 128: 
>>> 129:   static_assert(sizeof(intptr_t) == sizeof(CardValue*), "simplifying assumption");
>> 
>> Why check `sizeof(intptr_t)` instead of `uintptr_t` here?
>
> I mean, the change uses `uintptr_t` throughput, and probably the size of `intptr_t` and `uintptr_t` must be(?) the same, but why not check the actually used type?

typo - fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23032#discussion_r1912984142


More information about the hotspot-gc-dev mailing list