summaryrefslogtreecommitdiffstats
path: root/include/clang
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-08-25 20:27:58 +0000
committerHans Wennborg <hans@hanshq.net>2017-08-25 20:27:58 +0000
commitb47c628b1c5c88a4db60d2dda6411a2365a45dd1 (patch)
tree2af2d5c20ef43f57c69ef4adc8da28cbc6553ebf /include/clang
parent9fe12dfae3fad93aec4ba283d5099ee69e7fc164 (diff)
Merging r311695:
------------------------------------------------------------------------ r311695 | rsmith | 2017-08-24 13:10:33 -0700 (Thu, 24 Aug 2017) | 9 lines [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). Do not sanitize the 'this' pointer of a member call operator for a lambda with no capture-default, since that call operator can legitimately be called with a null this pointer from the static invoker function. Any actual call with a null this pointer should still be caught in the caller (if it is being sanitized). This reinstates r311589 (reverted in r311680) with the above fix. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@311799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/DeclCXX.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index c39eaee9b1..2f735c5506 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -2028,7 +2028,10 @@ public:
/// \brief Returns the type of the \c this pointer.
///
- /// Should only be called for instance (i.e., non-static) methods.
+ /// Should only be called for instance (i.e., non-static) methods. Note
+ /// that for the call operator of a lambda closure type, this returns the
+ /// desugared 'this' type (a pointer to the closure type), not the captured
+ /// 'this' type.
QualType getThisType(ASTContext &C) const;
unsigned getTypeQualifiers() const {