summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2017-03-21 20:08:59 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2017-03-21 20:08:59 +0000
commit56c7e88c2cd8f4f6d440f50d9f19401763f3122b (patch)
tree387c614351099aaccde94582e47a058120215ca3 /llvm/lib/Transforms
parentce39fdd6eeabc4a007ce7821a247cc58b816e0d7 (diff)
downloadbcm5719-llvm-56c7e88c2cd8f4f6d440f50d9f19401763f3122b.tar.gz
bcm5719-llvm-56c7e88c2cd8f4f6d440f50d9f19401763f3122b.zip
Let llvm.objectsize be conservative with null pointers
This adds a parameter to @llvm.objectsize that makes it return conservative values if it's given null. This fixes PR23277. Differential Revision: https://reviews.llvm.org/D28494 llvm-svn: 298430
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index afcf86547c7..8784fa989ea 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -2185,8 +2185,9 @@ bool AddressSanitizer::runOnFunction(Function &F) {
(ClInstrumentationWithCallsThreshold >= 0 &&
ToInstrument.size() > (unsigned)ClInstrumentationWithCallsThreshold);
const DataLayout &DL = F.getParent()->getDataLayout();
- ObjectSizeOffsetVisitor ObjSizeVis(DL, TLI, F.getContext(),
- /*RoundToAlign=*/true);
+ ObjectSizeOpts ObjSizeOpts;
+ ObjSizeOpts.RoundToAlign = true;
+ ObjectSizeOffsetVisitor ObjSizeVis(DL, TLI, F.getContext(), ObjSizeOpts);
// Instrument.
int NumInstrumented = 0;
OpenPOWER on IntegriCloud