[PATCH] D100683: [scudo][standalone] Fix -Werror=empty-body error on Fuchsia

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 16 13:38:34 PDT 2021


cryptoad created this revision.
cryptoad added reviewers: mcgrathr, vitalybuka.
cryptoad requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Some gcc builders use this, resulting in breakage when the `DCHECK` is
empty. Add braces.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100683

Files:
  compiler-rt/lib/scudo/standalone/fuchsia.cpp


Index: compiler-rt/lib/scudo/standalone/fuchsia.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/fuchsia.cpp
+++ compiler-rt/lib/scudo/standalone/fuchsia.cpp
@@ -96,10 +96,11 @@
   // No need to track the Vmo if we don't intend on resizing it. Close it.
   if (Flags & MAP_RESIZABLE) {
     DCHECK(Data);
-    if (Data->Vmo == ZX_HANDLE_INVALID)
+    if (Data->Vmo == ZX_HANDLE_INVALID) {
       Data->Vmo = Vmo;
-    else
+    } else {
       DCHECK_EQ(Data->Vmo, Vmo);
+    }
   } else {
     CHECK_EQ(_zx_handle_close(Vmo), ZX_OK);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100683.338220.patch
Type: text/x-patch
Size: 600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210416/8622e591/attachment.bin>


More information about the llvm-commits mailing list