aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 6f32492..3bd470b 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3575,10 +3575,7 @@ build_vec_init (tree base, tree maxindex, tree init,
/* Don't check an array new when -fno-exceptions. */
}
else if (flag_sanitize & SANITIZE_BOUNDS
- && current_function_decl
- && !lookup_attribute ("no_sanitize_undefined",
- DECL_ATTRIBUTES
- (current_function_decl)))
+ && do_ubsan_in_current_function ())
{
/* Make sure the last element of the initializer is in bounds. */
finish_expr_stmt