[PATCH] D103304: Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).
Kevin Athey via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 2 14:16:24 PDT 2021
kda added inline comments.
================
Comment at: compiler-rt/lib/asan/asan_rtl.cpp:402
+ if (&__asan_detect_use_after_return_always &&
+ __asan_detect_use_after_return_always) {
+ __asan_option_detect_stack_use_after_return = 1;
----------------
morehouse wrote:
> According to the comment above, we should not override the runtime flag when this is 1.
Check the code in AddressSanitizer, this global (__asan_detect_use_after_return_always) is only created when ClUseAfterReturn is set to 2.
================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:2654
+ M, IntTy, /*isConstant=*/true, GlobalValue::WeakODRLinkage,
+ ConstantInt::get(IntTy, 1), "__asan_detect_use_after_return_always");
+ });
----------------
morehouse wrote:
> The constant value 1 is also inconsistent with the comment in the runtime (should be 2).
I could change it if you felt it made the code clearer. __asan_detect_use_after_return_always is functionally a boolean. It is only created if ClUseAfterReturn is equal to Always (2).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103304/new/
https://reviews.llvm.org/D103304
More information about the llvm-commits
mailing list