diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2013-10-24 09:17:24 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2013-10-24 09:17:24 +0000 |
commit | 340b0463e618e99fe666be8c0fd730c23c9e233d (patch) | |
tree | 9b5184eec4d827bd073a4d43d9e52999223220d9 /llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp | |
parent | c5cae0f20c946f1842544c7ffbf24659b3c81afc (diff) | |
download | llvm-340b0463e618e99fe666be8c0fd730c23c9e233d.zip llvm-340b0463e618e99fe666be8c0fd730c23c9e233d.tar.gz llvm-340b0463e618e99fe666be8c0fd730c23c9e233d.tar.bz2 |
fix PR17635: false positive with packed structures
LLVM optimizers may widen accesses to packed structures that overflow the structure itself, but should be in bounds up to the alignment of the object
llvm-svn: 193317
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp b/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp index 4a9e950..7a9f0f6 100644 --- a/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp +++ b/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp @@ -172,7 +172,8 @@ bool BoundsChecking::runOnFunction(Function &F) { TrapBB = 0; BuilderTy TheBuilder(F.getContext(), TargetFolder(TD)); Builder = &TheBuilder; - ObjectSizeOffsetEvaluator TheObjSizeEval(TD, TLI, F.getContext()); + ObjectSizeOffsetEvaluator TheObjSizeEval(TD, TLI, F.getContext(), + /*RoundToAlign=*/true); ObjSizeEval = &TheObjSizeEval; // check HANDLE_MEMORY_INST in include/llvm/Instruction.def for memory |