[PATCH] D77182: [AddressSanitizer] Fix for wrong argument values appearing in backtraces

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 10:51:30 PDT 2020


eugenis accepted this revision.
eugenis added a comment.

LGTM with 2 comments



================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:2991
+static void
+collectArgumentAllocaInitInsts(AddressSanitizer &ASan, Instruction &InsBefore,
+                               SmallVectorImpl<Instruction *> &InitInsts) {
----------------
Mention "uninstrumented" (alloca) or something like that in the function name to make it clear that this function does not break regular alloca instrumentation by moving stores before stack poisoning.

This only really affects -O0 compilation, right?


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:3008
+    if (auto *Cast = dyn_cast<CastInst>(It)) {
+      if (isa<Argument>(Cast->getOperand(0)))
+        ArgCasts.push_back(Cast);
----------------
It looks like it would be simpler and cheaper to move this check down to the initializer of IsArgInitViaCast, and get rid of the vector update and lookup.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77182





More information about the llvm-commits mailing list