fix PR17635: false positive with packed structures
[oota-llvm.git] / lib / Transforms / Instrumentation / BoundsChecking.cpp
index 4a9e9503675050637980fa122de557a51f0bcf04..7a9f0f69fbdf22e3c2e44f9a4739f972fcbc085c 100644 (file)
@@ -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