This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Avoid LSR crash on large integer inputs
ClosedPublic

Authored by jmorse on Jan 4 2021, 9:35 AM.

Details

Summary

It turns out that D87494 will crash when fed an __int128 with a very large offset. Storing an oversized APInt to an int64_t will assert.

This patch adds a regression test and adjusts the equivalent value collecting code to filter out any values where the offset can't be represented by an int64_t. This means that for very large integers with very large offsets, the variable location will become undef, which is the same behaviour as before D87494.

Diff Detail

Event Timeline

jmorse created this revision.Jan 4 2021, 9:35 AM
jmorse requested review of this revision.Jan 4 2021, 9:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2021, 9:35 AM
markus accepted this revision.Jan 4 2021, 10:05 PM

Ugh, there is always some pathological case one forgets to handle. Anyway this LGTM and thanks for fixing!

This revision is now accepted and ready to land.Jan 4 2021, 10:05 PM
This revision was landed with ongoing or failed builds.Jan 5 2021, 2:27 AM
This revision was automatically updated to reflect the committed changes.