[PATCH] D89552: ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 16:01:17 PDT 2020


MaskRay added inline comments.


================
Comment at: compiler-rt/lib/asan/asan_thread.cpp:369
     bottom = fake_stack()->AddrIsInFakeStack(addr);
-    CHECK(bottom);
+    if (bottom == 0) {
+      return 0;
----------------
marxin wrote:
> kcc wrote:
> > when does this happen? When a variable is too large to fit in the fake stack? 
> The function is only called from IsInvalidPointerPair which finds whether a pointer is a pointer to a stack/global/heap variable.
> So it's fine to return 0 when the function is called for a non-stack variable and fake stacks are enabled.
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

The coding standard prefer dropping braces for simple single statements.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89552



More information about the llvm-commits mailing list