aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2013-10-24 09:17:24 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2013-10-24 09:17:24 +0000
commit5e1d0d39db5fefe013f58c124a94694f96bce2f1 (patch)
treeb4dcda463d9c83c54bd43c0324baf253d3f03287 /lib/Transforms
parent2f21452ba1ee5bde8fee438b4cf1a1ce95beb6ca (diff)
downloadexternal_llvm-5e1d0d39db5fefe013f58c124a94694f96bce2f1.zip
external_llvm-5e1d0d39db5fefe013f58c124a94694f96bce2f1.tar.gz
external_llvm-5e1d0d39db5fefe013f58c124a94694f96bce2f1.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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Instrumentation/BoundsChecking.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Instrumentation/BoundsChecking.cpp b/lib/Transforms/Instrumentation/BoundsChecking.cpp
index 4a9e950..7a9f0f6 100644
--- a/lib/Transforms/Instrumentation/BoundsChecking.cpp
+++ b/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