]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR sanitizer/80063 (gcc/asan.c: PVS-Studio: Incorrect Block Delimitation (CWE...
authorMarek Polacek <polacek@redhat.com>
Mon, 20 Mar 2017 13:31:28 +0000 (13:31 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 20 Mar 2017 13:31:28 +0000 (13:31 +0000)
PR sanitizer/80063
* asan.c (DEF_SANITIZER_BUILTIN): Use do { } while (0).

From-SVN: r246278

gcc/ChangeLog
gcc/asan.c

index f8b56a2807fffcedaab47b93d7f9c604aeadc5f0..90c855632145c52ce6ebf5a520b3fecae3262b96 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-20  Marek Polacek  <polacek@redhat.com>
+
+       PR sanitizer/80063
+       * asan.c (DEF_SANITIZER_BUILTIN): Use do { } while (0).
+
 2017-03-20  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80113
index edcc6ea5a913825c1d11c61de113a5dea3183c44..a13679d030f339900c3d43213008b9158ff69f86 100644 (file)
@@ -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"