summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-03-14 16:48:29 +0000
committerVedant Kumar <vsk@apple.com>2017-03-14 16:48:29 +0000
commit2b9f48afdd67dcfdd37d7afe6a34059cd390fc21 (patch)
treec80609bb8a097226adecbe0ed69c393442af1a04 /clang/lib/CodeGen/CGDecl.cpp
parentc5d628400ff7e42a0b83e8e126b89ba45c1469e2 (diff)
downloadbcm5719-llvm-2b9f48afdd67dcfdd37d7afe6a34059cd390fc21.tar.gz
bcm5719-llvm-2b9f48afdd67dcfdd37d7afe6a34059cd390fc21.zip
[ubsan] Use the nicer nullability diagnostic handlers
This is a follow-up to r297700 (Add a nullability sanitizer). It addresses some FIXME's re: using nullability-specific diagnostic handlers from compiler-rt, now that the necessary handlers exist. check-ubsan test updates to follow. llvm-svn: 297750
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index cfadce5c221..edfc6741374 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -685,11 +685,10 @@ void CodeGenFunction::EmitNullabilityCheck(LValue LHS, llvm::Value *RHS,
// hand side must be nonnull.
SanitizerScope SanScope(this);
llvm::Value *IsNotNull = Builder.CreateIsNotNull(RHS);
- // FIXME: The runtime shouldn't refer to a 'reference'.
llvm::Constant *StaticData[] = {
EmitCheckSourceLocation(Loc), EmitCheckTypeDescriptor(LHS.getType()),
- llvm::ConstantInt::get(Int8Ty, 1),
- llvm::ConstantInt::get(Int8Ty, TCK_ReferenceBinding)};
+ llvm::ConstantInt::get(Int8Ty, 0), //< The LogAlignment info is unused.
+ llvm::ConstantInt::get(Int8Ty, TCK_NonnullAssign)};
EmitCheck({{IsNotNull, SanitizerKind::NullabilityAssign}},
SanitizerHandler::TypeMismatch, StaticData, RHS);
}
OpenPOWER on IntegriCloud