[compiler-rt] r242791 - Reverting r242787 ("[asan] Fix the freopen interceptor to allow NULL instead of a filename") to investigate buildbot failure.

Kuba Brecka kuba.brecka at gmail.com
Tue Jul 21 08:27:40 PDT 2015


Author: kuba.brecka
Date: Tue Jul 21 10:27:40 2015
New Revision: 242791

URL: http://llvm.org/viewvc/llvm-project?rev=242791&view=rev
Log:
Reverting r242787 ("[asan] Fix the freopen interceptor to allow NULL instead of a filename") to investigate buildbot failure.


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/trunk/test/asan/TestCases/Posix/freopen.cc

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=242791&r1=242790&r2=242791&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Tue Jul 21 10:27:40 2015
@@ -4671,7 +4671,7 @@ INTERCEPTOR(__sanitizer_FILE *, freopen,
             __sanitizer_FILE *fp) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, freopen, path, mode, fp);
-  if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
+  COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
   COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1);
   COMMON_INTERCEPTOR_FILE_CLOSE(ctx, fp);
   __sanitizer_FILE *res = REAL(freopen)(path, mode, fp);
@@ -4702,7 +4702,7 @@ INTERCEPTOR(__sanitizer_FILE *, freopen6
             __sanitizer_FILE *fp) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, freopen64, path, mode, fp);
-  if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
+  COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
   COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1);
   COMMON_INTERCEPTOR_FILE_CLOSE(ctx, fp);
   __sanitizer_FILE *res = REAL(freopen64)(path, mode, fp);

Modified: compiler-rt/trunk/test/asan/TestCases/Posix/freopen.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/freopen.cc?rev=242791&r1=242790&r2=242791&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/freopen.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/freopen.cc Tue Jul 21 10:27:40 2015
@@ -1,12 +0,0 @@
-// RUN: %clangxx_asan -O0 %s -o %t && %run %t
-
-#include <assert.h>
-#include <stdio.h>
-
-int main() {
-  FILE *fp = fopen("/dev/null", "w");
-  assert(fp);
-  freopen(NULL, "a", fp);
-  fclose(fp);
-  return 0;
-}





More information about the llvm-commits mailing list