[PATCH] D15644: [asan] Use private aliases for global variables (compiler-rt part).

Yury Gribov via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 13:08:46 PST 2016


ygribov added inline comments.

================
Comment at: lib/asan/asan_globals.cc:143
@@ +142,3 @@
+  u8 *odr_indicator = reinterpret_cast<u8 *>(g->odr_indicator);
+  if (!*odr_indicator) return;
+  // If *odr_indicator is not zero, some module have already registered
----------------
I think you forgot to set *odr_indicator to 1 here? Or rather to some descriptive enum value e.g. DEFINED. This would also simplify below description.

================
Comment at: lib/asan/asan_globals.cc:156
@@ +155,3 @@
+
+// Check ODR violation for given global G by checking if it's already posoned.
+// We use this method in case compiler doesn't use private aliases for global
----------------
s/posoned/poisoned/

================
Comment at: lib/asan/asan_globals.cc:176
@@ +175,3 @@
+// case we may poison same symbol mutiple times, that can help us to
+// cheeply detect ODR violation: if we try poison already poisoned global,
+// we have ODR violation error.
----------------
Some spelling suggestions: s/cheeply/cheaply/, s/try poison/try to poison an/

================
Comment at: lib/asan/asan_globals.cc:247
@@ +246,3 @@
+    u8 *odr_indicator = reinterpret_cast<u8 *>(g->odr_indicator);
+    *odr_indicator = 0;
+  }
----------------
Got it.


http://reviews.llvm.org/D15644





More information about the llvm-commits mailing list