[compiler-rt] r174883 - [sanitizer] Remove an extra va_copy.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Mon Feb 11 06:08:12 PST 2013


Author: eugenis
Date: Mon Feb 11 08:08:12 2013
New Revision: 174883

URL: http://llvm.org/viewvc/llvm-project?rev=174883&view=rev
Log:
[sanitizer] Remove an extra va_copy.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=174883&r1=174882&r2=174883&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Mon Feb 11 08:08:12 2013
@@ -24,6 +24,10 @@
 
 #include <stdarg.h>
 
+#ifdef _WIN32
+#define va_copy(dst, src) ((dst) = (src))
+#endif // _WIN32
+
 #if SANITIZER_INTERCEPT_READ
 INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
   void* ctx;

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc?rev=174883&r1=174882&r2=174883&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc Mon Feb 11 08:08:12 2013
@@ -14,10 +14,6 @@
 //===----------------------------------------------------------------------===//
 #include <stdarg.h>
 
-#ifdef _WIN32
-#define va_copy(dst, src) ((dst) = (src))
-#endif // _WIN32
-
 struct ScanfDirective {
   int argIdx;      // argument index, or -1 of not specified ("%n$")
   int fieldWidth;
@@ -274,10 +270,7 @@ static int scanf_get_store_size(ScanfDir
 
 // Common part of *scanf interceptors.
 // Process format string and va_list, and report all store ranges.
-static void scanf_common(void *ctx, const char *format, va_list ap_const) {
-  va_list aq;
-  va_copy(aq, ap_const);
-
+static void scanf_common(void *ctx, const char *format, va_list aq) {
   const char *p = format;
 
   while (p) {





More information about the llvm-commits mailing list