[PATCH] D18121: [sanitizer] On OS X, verify that interceptors work and abort if not

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 23:45:10 PST 2016


kubabrecka added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:636
@@ +635,3 @@
+  CHECK(dladdr(dlopen_addr, &info_pthread_create));
+  if (internal_strcmp(info.dli_fname, info_pthread_create.dli_fname) != 0) {
+    Report(
----------------
filcab wrote:
> Wouldn't `if (info.dli_fbase != info_pthread_create.dli_fbase)` work as well? Seems easier to read.
It seems to work, but I don't think it's guaranteed by the API.  Since we're doing this once only, it's not a big deal performance-wise, and I think readability is fine here – we *are* actually comparing two strings.


http://reviews.llvm.org/D18121





More information about the llvm-commits mailing list