This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Fix an assert in EmitNullConstant
ClosedPublic

Authored by ahatanak on Sep 7 2016, 1:16 PM.

Details

Summary

r235815 changed CGRecordLowering::accumulateBases to ignore non-virtual bases of size 0, which prevented adding those non-virtual bases to CGRecordLayout's NonVirtualBases. EmitNullConstant calls CGRecordLayout::getNonVirtualBaseLLVMFieldNo to get the field number of the base, which causes an assert. This patch fixes the bug.

Diff Detail

Repository
rL LLVM

Event Timeline

ahatanak updated this revision to Diff 70589.Sep 7 2016, 1:16 PM
ahatanak retitled this revision from to [CodeGen] Fix an assert in EmitNullConstant.
ahatanak updated this object.
ahatanak added a reviewer: rjmccall.
ahatanak added a subscriber: cfe-commits.
rjmccall accepted this revision.Sep 9 2016, 1:39 PM
rjmccall edited edge metadata.
This revision is now accepted and ready to land.Sep 9 2016, 1:39 PM
This revision was automatically updated to reflect the committed changes.