[compiler-rt] r227559 - Replace code dup with a macro.

Yury Gribov y.gribov at samsung.com
Thu Jan 29 22:18:46 PST 2015


Author: ygribov
Date: Fri Jan 30 00:18:46 2015
New Revision: 227559

URL: http://llvm.org/viewvc/llvm-project?rev=227559&view=rev
Log:
Replace code dup with a macro.
Differential Revision: http://reviews.llvm.org/D7172


Modified:
    compiler-rt/trunk/lib/asan/asan_report.cc
    compiler-rt/trunk/lib/msan/msan_interceptors.cc

Modified: compiler-rt/trunk/lib/asan/asan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=227559&r1=227558&r2=227559&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Fri Jan 30 00:18:46 2015
@@ -53,7 +53,7 @@ void AppendToErrorMessageBuffer(const ch
                      buffer, remaining);
     error_message_buffer[error_message_buffer_size - 1] = '\0';
     // FIXME: reallocate the buffer instead of truncating the message.
-    error_message_buffer_pos += remaining > length ? length : remaining;
+    error_message_buffer_pos += Min(remaining, length);
   }
 }
 

Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=227559&r1=227558&r2=227559&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Fri Jan 30 00:18:46 2015
@@ -952,7 +952,7 @@ INTERCEPTOR(SSIZE_T, recvfrom, int fd, v
     __msan_unpoison(buf, res);
     if (srcaddr) {
       SIZE_T sz = *addrlen;
-      __msan_unpoison(srcaddr, (sz < srcaddr_sz) ? sz : srcaddr_sz);
+      __msan_unpoison(srcaddr, Min(sz, srcaddr_sz));
     }
   }
   return res;





More information about the llvm-commits mailing list