RFR: 8334239: Introduce macro for ubsan method/function exclusions

David Holmes dholmes at openjdk.org
Mon Jun 17 05:37:11 UTC 2024


On Fri, 14 Jun 2024 13:39:14 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> A number of functions/methods have to be excluded from ubsan detection (e.g. because they do things that ubsan warns about, however it is still valid what is done there).
> We can simplify this by introducing a macro (similar to asan-related ATTRIBUTE_NO_ASAN, see sanitizers/address.hpp).
> Currently something like this is used :
> 
> #if defined(__clang__) || defined(__GNUC__)
> __attribute__((no_sanitize("undefined")))
> #endif

In keeping with address.hpp and leak.hpp the header would either be called undefinedbehaviour.hpp or just ub.hpp for short.

I think the actual attribute would read better if placed on the line before the function definition.

Thanks.

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

Changes requested by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19722#pullrequestreview-2121918399


More information about the hotspot-dev mailing list