This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Check the number of operands before accessing the first one
AcceptedPublic

Authored by phosek on Aug 6 2020, 12:51 PM.

Details

Reviewers
MaskRay
pcc
Summary

After D72899, it's possible to use empty associated symbol which will
get lowered to sh_link set to 0. However, if the operand is missing
altogether, getLinkedToSymbol is going to fail. Avoid the failure
by checking the number of arguments first.

Diff Detail

Event Timeline

phosek created this revision.Aug 6 2020, 12:51 PM
MaskRay accepted this revision.Aug 9 2020, 2:45 PM

LGTM if the regression test will be added in D76802 or elsewhere

This revision is now accepted and ready to land.Aug 9 2020, 2:45 PM