AddressSanitizer: simplify IntervalsAreSeparate function

llvm-svn: 150569
This commit is contained in:
Alexey Samsonov 2012-02-15 08:27:34 +00:00
parent 899f46c113
commit 278c25f241
1 changed files with 3 additions and 12 deletions

View File

@ -77,20 +77,11 @@ void *AsanDoesNotSupportStaticLinkage() {
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.