[llvm-commits] [compiler-rt] r150569 - /compiler-rt/trunk/lib/asan/asan_mac.cc

Alexey Samsonov samsonov at google.com
Wed Feb 15 00:27:34 PST 2012


Author: samsonov
Date: Wed Feb 15 02:27:34 2012
New Revision: 150569

URL: http://llvm.org/viewvc/llvm-project?rev=150569&view=rev
Log:
AddressSanitizer: simplify IntervalsAreSeparate function

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

Modified: compiler-rt/trunk/lib/asan/asan_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mac.cc?rev=150569&r1=150568&r2=150569&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mac.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_mac.cc Wed Feb 15 02:27:34 2012
@@ -77,20 +77,11 @@
   return NULL;
 }
 
-inline bool IntervalsAreSeparate(uintptr_t start1, uintptr_t end1,
-                                 uintptr_t start2, uintptr_t end2) {
+static inline bool IntervalsAreSeparate(uintptr_t start1, uintptr_t end1,
+                                        uintptr_t start2, uintptr_t end2) {
   CHECK(start1 <= end1);
   CHECK(start2 <= end2);
-  if (start1 == start2) {
-    return false;
-  } else {
-    if (start1 < start2) {
-      return (end1 < start2);
-    } else {
-      return (end2 < start1);
-    }
-  }
-  return false;
+  return (end1 < start2) || (end2 < start1);
 }
 
 // FIXME: this is thread-unsafe, but should not cause problems most of the time.





More information about the llvm-commits mailing list