From a74560ebeb9e088e410139595a6ca74f6720b502 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 20 Mar 2017 13:31:28 +0000 Subject: re PR sanitizer/80063 (gcc/asan.c: PVS-Studio: Incorrect Block Delimitation (CWE-483)) PR sanitizer/80063 * asan.c (DEF_SANITIZER_BUILTIN): Use do { } while (0). From-SVN: r246278 --- gcc/asan.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/asan.c') diff --git a/gcc/asan.c b/gcc/asan.c index edcc6ea..a13679d 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -2567,10 +2567,12 @@ initialize_sanitizer_builtins (void) #define DEF_BUILTIN_STUB(ENUM, NAME) #undef DEF_SANITIZER_BUILTIN #define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ - decl = add_builtin_function ("__builtin_" NAME, TYPE, ENUM, \ - BUILT_IN_NORMAL, NAME, NULL_TREE); \ - set_call_expr_flags (decl, ATTRS); \ - set_builtin_decl (ENUM, decl, true); + do { \ + decl = add_builtin_function ("__builtin_" NAME, TYPE, ENUM, \ + BUILT_IN_NORMAL, NAME, NULL_TREE); \ + set_call_expr_flags (decl, ATTRS); \ + set_builtin_decl (ENUM, decl, true); \ + } while (0); #include "sanitizer.def" -- cgit v1.1