[llvm-commits] [compiler-rt] r156538 - /compiler-rt/trunk/lib/asan/asan_rtl.cc

Alexander Potapenko glider at google.com
Thu May 10 05:03:09 PDT 2012


Author: glider
Date: Thu May 10 07:03:09 2012
New Revision: 156538

URL: http://llvm.org/viewvc/llvm-project?rev=156538&view=rev
Log:
Fix ReadFileToBuffer to return 0 on failure (-1 is too large if returned as size_t).

Modified:
    compiler-rt/trunk/lib/asan/asan_rtl.cc

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=156538&r1=156537&r2=156538&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Thu May 10 07:03:09 2012
@@ -86,7 +86,7 @@
   // The files we usually open are not seekable, so try different buffer sizes.
   for (size_t size = kMinFileLen; size <= max_len; size *= 2) {
     int fd = AsanOpenReadonly(file_name);
-    if (fd < 0) return -1;
+    if (fd < 0) return 0;
     AsanUnmapOrDie(*buff, *buff_size);
     *buff = (char*)AsanMmapSomewhereOrDie(size, __FUNCTION__);
     *buff_size = size;





More information about the llvm-commits mailing list