diff options
| author | Vedant Kumar <vsk@apple.com> | 2017-03-14 16:48:29 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2017-03-14 16:48:29 +0000 |
| commit | 2b9f48afdd67dcfdd37d7afe6a34059cd390fc21 (patch) | |
| tree | c80609bb8a097226adecbe0ed69c393442af1a04 /clang/lib/CodeGen/CGDecl.cpp | |
| parent | c5d628400ff7e42a0b83e8e126b89ba45c1469e2 (diff) | |
| download | bcm5719-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.cpp | 5 |
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); } |

