This is an archive of the discontinued LLVM Phabricator instance.

[SROA] prevent crash on large memset length (PR50910)
ClosedPublic

Authored by spatel on Jul 21 2021, 10:18 AM.

Details

Summary

I don't know much about this pass, but we need a stronger check on the memset length arg to avoid an assert. The current code was added with D59000.
The test is reduced from:
https://llvm.org/PR50910

Diff Detail

Event Timeline

spatel created this revision.Jul 21 2021, 10:18 AM
spatel requested review of this revision.Jul 21 2021, 10:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2021, 10:18 AM
spatel updated this revision to Diff 361625.Jul 26 2021, 5:14 AM
spatel added reviewers: lebedev.ri, nikic.

Rebased - I found another bug ( https://llvm.org/PR50888 ) near here and patched it with f14495dc75d7 .

lebedev.ri accepted this revision.Jul 30 2021, 6:16 AM

I suppose we could instead clamp to the maximal remaining alloca size,
but it's UB so it doesn't seem worth spending too much time on it.
Seems fine to me.

This revision is now accepted and ready to land.Jul 30 2021, 6:16 AM
This revision was landed with ongoing or failed builds.Jul 31 2021, 11:08 AM
This revision was automatically updated to reflect the committed changes.