[PATCH] [asan] Do not return void expression.

Tetsuo Kiso tetsuo.sakai21 at gmail.com
Thu Apr 17 08:29:11 PDT 2014


tetsuok added you to the CC list for the revision "[asan] Do not return void expression.".

Hi kcc,

Although clang++ does not warn this, it's better to avoid returning void
expression.

http://reviews.llvm.org/D3412

Files:
  lib/Transforms/Instrumentation/AddressSanitizer.cpp

Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -751,8 +751,10 @@
 
   // Instrument a 1-, 2-, 4-, 8-, or 16- byte access with one check.
   if (TypeSize == 8  || TypeSize == 16 ||
-      TypeSize == 32 || TypeSize == 64 || TypeSize == 128)
-    return instrumentAddress(I, I, Addr, TypeSize, IsWrite, 0, UseCalls);
+      TypeSize == 32 || TypeSize == 64 || TypeSize == 128) {
+    instrumentAddress(I, I, Addr, TypeSize, IsWrite, 0, UseCalls);
+    return;
+  }
   // Instrument unusual size (but still multiple of 8).
   // We can not do it with a single check, so we do 1-byte check for the first
   // and the last bytes. We call __asan_report_*_n(addr, real_size) to be able
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3412.1.patch
Type: text/x-patch
Size: 875 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140417/096d35ea/attachment.bin>


More information about the llvm-commits mailing list