[PATCH] D33286: Don't require ThreadState to be contained within tls on all platforms
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 09:02:36 PDT 2017
fjricci updated this revision to Diff 99314.
fjricci added a comment.
Fix if condition equality
https://reviews.llvm.org/D33286
Files:
lib/tsan/rtl/tsan_rtl_thread.cc
Index: lib/tsan/rtl/tsan_rtl_thread.cc
===================================================================
--- lib/tsan/rtl/tsan_rtl_thread.cc
+++ lib/tsan/rtl/tsan_rtl_thread.cc
@@ -252,14 +252,13 @@
// Check that the thr object is in tls;
const uptr thr_beg = (uptr)thr;
const uptr thr_end = (uptr)thr + sizeof(*thr);
- CHECK_GE(thr_beg, tls_addr);
- CHECK_LE(thr_beg, tls_addr + tls_size);
- CHECK_GE(thr_end, tls_addr);
- CHECK_LE(thr_end, tls_addr + tls_size);
- // Since the thr object is huge, skip it.
- MemoryRangeImitateWrite(thr, /*pc=*/ 2, tls_addr, thr_beg - tls_addr);
- MemoryRangeImitateWrite(thr, /*pc=*/ 2,
- thr_end, tls_addr + tls_size - thr_end);
+ if (thr_beg >= tls_addr && thr_beg <= tls_addr + tls_size &&
+ thr_end >= tls_addr && thr_end <= tls_addr + tls_size) {
+ // Since the thr object is huge, skip it.
+ MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr, thr_beg - tls_addr);
+ MemoryRangeImitateWrite(thr, /*pc=*/2, thr_end,
+ tls_addr + tls_size - thr_end);
+ }
}
}
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33286.99314.patch
Type: text/x-patch
Size: 1150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170517/91dd6978/attachment.bin>
More information about the llvm-commits
mailing list