[PATCH] D71491: [ubsan] Check implicit casts in ObjC for-in statements

Dan Liew via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 13 21:27:20 PST 2019


delcypher added inline comments.


================
Comment at: compiler-rt/lib/ubsan/ubsan_value.cpp:29
+const char *__ubsan::getObjCClassName(ValueHandle Pointer) {
+#if defined(__APPLE__)
+  // We need to query the ObjC runtime for some information, but do not want
----------------
The compiler-rt codebase tends to use `SANITIZER_MAC` macro (defined to be 1 if Apple otherwise it's 0) rather than `__APPLE__`.


================
Comment at: compiler-rt/lib/ubsan/ubsan_value.cpp:37
+
+  if (!AttemptedDlopen) {
+    ObjCHandle = dlopen(
----------------
You might want some sort of lock here (or atomic variable) to ensure we don't race and try to `dlopen()` multiple times.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71491/new/

https://reviews.llvm.org/D71491





More information about the cfe-commits mailing list