8355979: ATTRIBUTE_NO_UBSAN needs to be extended to handle float divisions by zero on AIX

Reviewed-by: jkern, lucy
This commit is contained in:
Matthias Baesken 2025-05-06 14:15:37 +00:00
parent bfdafb7626
commit 088825ed88
2 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024 SAP SE. All rights reserved.
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,10 @@
// Useful if the function or method is known to do something special or even 'dangerous', for
// example causing desired signals/crashes.
#ifdef UNDEFINED_BEHAVIOR_SANITIZER
#if defined(__clang__) || defined(__GNUC__)
#if defined(__clang__)
#define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined","float-divide-by-zero")))
#endif
#if defined(__GNUC__) && !defined(__clang__)
#define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
#endif
#endif

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024 SAP SE. All rights reserved.
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,10 @@
* following function or method.
*/
#ifdef UNDEFINED_BEHAVIOR_SANITIZER
#if defined(__clang__) || defined(__GNUC__)
#if defined(__clang__)
#define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined","float-divide-by-zero")))
#endif
#if defined(__GNUC__) && !defined(__clang__)
#define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
#endif
#endif