For ASan this will effectively serve as a synonym for
attribute((no_sanitize("address")))
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Given this is a minor change that only affects users of disable_sanitizer_instrumentation, I'm inclined towards landing it.
LGTM
clang/test/CodeGen/asan-globals.cpp | ||
---|---|---|
61 | Does this test rely on the metadata being in the same order as the global declarations in the source? Feels brittle and hard to understand - could you check if the regexps could be made more precise? |
Should we have in AddressSanitizer.cpp the following for consistency with other sanitizers?
if (F.hasFnAttribute(Attribute::DisableSanitizerInstrumentation))
return false;
Should we have in AddressSanitizer.cpp the following for consistency with other sanitizers?
Good catch, without that disable_sanitizer_instrumentation could not override sanitize_address.
I fixed this and added a test.
clang/test/CodeGen/asan-globals.cpp | ||
---|---|---|
61 | llvm.asan.globals above actually look as follows: !llvm.asan.globals = !{!0, !2, !4, !6, !7, !8, !9, !11, !13, !15} , so the placeholder variables (e.g. ATTR_GLOBAL and DISABLE_INSTR_GLOBAL) actually match just the metadata node numbers. |
I think we dropped the ball on this - was it ever re-reverted?
Is it still worth trying to land this?
Does this test rely on the metadata being in the same order as the global declarations in the source? Feels brittle and hard to understand - could you check if the regexps could be made more precise?