summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-12-08 01:51:47 +0000
committerVedant Kumar <vsk@apple.com>2017-12-08 01:51:47 +0000
commit36347d917f72eaf2c625369761a8dda95bea10b1 (patch)
tree48a9697b1cb67045d12f8f749d65464ce6a7c2ca /clang/lib/CodeGen/CodeGenFunction.h
parent9c36859b33b386fbfa9599646de1e2ae01158180 (diff)
downloadbcm5719-llvm-36347d917f72eaf2c625369761a8dda95bea10b1.tar.gz
bcm5719-llvm-36347d917f72eaf2c625369761a8dda95bea10b1.zip
[ubsan] Use pass_object_size info in bounds checks
Teach UBSan's bounds check to opportunistically use pass_object_size information to check array accesses. rdar://33272922 llvm-svn: 320128
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 1c8c2a5e360..1a66533f235 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3927,6 +3927,11 @@ public:
LValueBaseInfo *BaseInfo = nullptr,
TBAAAccessInfo *TBAAInfo = nullptr);
+ /// If \p E references a parameter with pass_object_size info or a constant
+ /// array size modifier, emit the object size divided by the size of \p EltTy.
+ /// Otherwise return null.
+ llvm::Value *LoadPassedObjectSize(const Expr *E, QualType EltTy);
+
void EmitSanitizerStatReport(llvm::SanitizerStatKind SSK);
private:
OpenPOWER on IntegriCloud