This is in preparation to a driver patch to add gcc 8's -fsanitize=pointer-compare and -fsanitize=pointer-subtract.
Disabled by default as this is still an experimental feature.
This is the llvm side of https://reviews.llvm.org/D59221
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
575 ↗ | (On Diff #190117) | These parameter lists are getting too long. Do we need to store the options or can we just check ClInvalidPointer* instead? Or, can we use an options struct? |
test/Instrumentation/AddressSanitizer/asan-detect-invalid-pointer-pair.ll | ||
2 ↗ | (On Diff #190117) | I think we can do --check-prefixes=CMP,NOSUB. |
12 ↗ | (On Diff #190117) | Do we also need to add --check-prefix=ALL? |
What is exactly going to be checked by -fsanitize=pointer-compare and -fsanitize=pointer-subtract?
Why this needs to be done in AddressSanitizer?
Is this going just checheck that pointers are from the same allocation?
Use backend option directly rather than introducing new parameters.
Add missing ALL check to test.
lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
575 ↗ | (On Diff #190117) | Yes the parameter are not necessary, I have removed them thanks! |
-fsanitize=pointer-compare and -fsanitize=pointer-subtract instrument comparison operation (<, <=, >, >=) and '-' operation with pointer operands.
It relies on AddressSanitizer to check the origin of the allocation. gcc also requires -fsanitize=address for -fsanitize=pointer-compare and -fsanitize=pointer-subtract, so I think it is expected to depend on Asan? Thanks!
test/Instrumentation/AddressSanitizer/asan-detect-invalid-pointer-pair.ll | ||
---|---|---|
2 ↗ | (On Diff #190117) | Well now we can just do --check-prefixes=CMP,NOSUB,ALL |
test/Instrumentation/AddressSanitizer/asan-detect-invalid-pointer-pair.ll | ||
---|---|---|
2 ↗ | (On Diff #190117) | Done thanks! |