]> granicus.if.org Git - clang/commit
[ubsan] PR34266: When sanitizing the 'this' value for a member function that happens...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Aug 2017 20:10:33 +0000 (20:10 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Aug 2017 20:10:33 +0000 (20:10 +0000)
commit9448f422a1cf7f06fc904bc2d74dbbed5bfe6972
tree9999778045fce63adb528e1cdc69cf9fa7f1f85a
parent6d8609db4d42605a8a0e2e2620e9e38bf1b29d3c
[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/trunk@311695 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclCXX.h
lib/CodeGen/CodeGenFunction.cpp
test/CodeGenCXX/catch-undef-behavior.cpp