llvm-project/llvm/test/Instrumentation/BoundsChecking
Arthur Eubanks 203296d642 [BoundsChecking] Fix merging of sizes
BoundsChecking uses ObjectSizeOffsetEvaluator to keep track of the
underlying size/offset of pointers in allocations.  However,
ObjectSizeOffsetVisitor (something ObjectSizeOffsetEvaluator
uses to check for constant sizes/offsets)
doesn't quite treat sizes and offsets the same way as
BoundsChecking.  BoundsChecking wants to know the size of the
underlying allocation and the current pointer's offset within
it, but ObjectSizeOffsetVisitor only cares about the size
from the pointer to the end of the underlying allocation.

This only comes up when merging two size/offset pairs. Add a new mode to
ObjectSizeOffsetVisitor which cares about the underlying size/offset
rather than the size from the current pointer to the end of the
allocation.

Fixes a false positive with -fsanitize=bounds.

Reviewed By: vitalybuka, asbirlea

Differential Revision: https://reviews.llvm.org/D131001
2022-08-03 17:21:19 -07:00
..
many-trap.ll
many-traps-2.ll
nosanitize-bounds.ll [SanitizerBounds] Add support for NoSanitizeBounds function 2022-03-01 18:47:02 +01:00
opt.ll Revert rest of `IRBuilderBase`'s short-circuiting folds 2021-10-28 02:15:14 +03:00
phi.ll
simple-32.ll
simple.ll [BoundsChecking] Fix merging of sizes 2022-08-03 17:21:19 -07:00