This is an archive of the discontinued LLVM Phabricator instance.

Fix PR35902: incorrect alignment used for ubsan check.
ClosedPublic

Authored by jyknight on Dec 10 2020, 3:10 PM.

Details

Summary

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.

Diff Detail

Event Timeline

jyknight requested review of this revision.Dec 10 2020, 3:10 PM
jyknight created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2020, 3:10 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rsmith accepted this revision.Dec 10 2020, 3:17 PM
rsmith added inline comments.
clang/lib/CodeGen/CGCXXABI.cpp
137–138

If you're so inclined, this would be better as MD->getParent()->isEffectivelyFinal().

This revision is now accepted and ready to land.Dec 10 2020, 3:17 PM
This revision was landed with ongoing or failed builds.Dec 28 2020, 3:33 PM
This revision was automatically updated to reflect the committed changes.