diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-08-23 19:39:04 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-08-23 19:39:04 +0000 |
commit | e3a5e8f03d9745764fa516baef37b23978a8fb46 (patch) | |
tree | 8a4f8cd892abeceb73349415595a7c4df910bc4a /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 0cb591fc4c5a5c8cf561e8f2b01e88941936578e (diff) | |
download | bcm5719-llvm-e3a5e8f03d9745764fa516baef37b23978a8fb46.tar.gz bcm5719-llvm-e3a5e8f03d9745764fa516baef37b23978a8fb46.zip |
[ubsan] PR34266: When sanitizing the 'this' value for a member function that happens to be a lambda call operator, use the lambda's 'this' pointer, not the captured enclosing 'this' pointer (if any).
llvm-svn: 311589
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 4201804e185..0df7d271070 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1014,11 +1014,11 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, } // Check the 'this' pointer once per function, if it's available. - if (CXXThisValue) { + if (CXXABIThisValue) { SanitizerSet SkippedChecks; SkippedChecks.set(SanitizerKind::ObjectSize, true); QualType ThisTy = MD->getThisType(getContext()); - EmitTypeCheck(TCK_Load, Loc, CXXThisValue, ThisTy, + EmitTypeCheck(TCK_Load, Loc, CXXABIThisValue, ThisTy, getContext().getTypeAlignInChars(ThisTy->getPointeeType()), SkippedChecks); } |