Fix PR35902: incorrect alignment used for ubsan check.
authorJames Y Knight <jyknight@google.com>
Thu, 10 Dec 2020 23:03:16 +0000 (18:03 -0500)
committerJames Y Knight <jyknight@google.com>
Mon, 28 Dec 2020 23:11:17 +0000 (18:11 -0500)
commit4ddf140c00408ecee9d20f4470e69e0f696d8f8a
tree872d679cfdfc880f27e201fc590af71ec4966f38
parent85af1d6257fac0741002f0144622f05c4ee1632c
Fix PR35902: incorrect alignment used for ubsan check.

UBSan was using the complete-object align rather than nv alignment
when checking the "this" pointer of a method.

Furthermore, CGF.CXXABIThisAlignment was also being set incorrectly,
due to an incorrectly negated test. The latter doesn't appear to have
had any impact, due to it not really being used anywhere.

Differential Revision: https://reviews.llvm.org/D93072
clang/lib/CodeGen/CGCXXABI.cpp
clang/lib/CodeGen/CodeGenFunction.cpp
clang/test/CodeGenCXX/catch-undef-behavior.cpp