This is an archive of the discontinued LLVM Phabricator instance.

[VE] Correct types of return/argument values for getAdjustedFrameSize()
ClosedPublic

Authored by kaz7 on Nov 20 2020, 4:29 AM.

Details

Summary

A getAdjustedFrameSize function may need to handle larger than 32 bits
integer, so change int to uint64_t.

Diff Detail

Event Timeline

kaz7 created this revision.Nov 20 2020, 4:29 AM
kaz7 requested review of this revision.Nov 20 2020, 4:29 AM
simoll accepted this revision.Nov 20 2020, 4:53 AM

LGTM. Did this actually overflow in the wild? A test would be nice.. but also hard to come by given that you'd need to manufacture such a large frame.

This revision is now accepted and ready to land.Nov 20 2020, 4:53 AM
kaz7 added a comment.Nov 20 2020, 5:48 PM

It's a good question. VE has 32 bits offset, so we don't consider such large frames or data structures seriously.

kaz7 updated this revision to Diff 306822.Nov 20 2020, 8:23 PM

Rebase and correct capitalization. Also add two regression tests. The
test_frame4294967296 function didn't allocate stack frame correctly before
this modification.

Previously:

lea %s13, -240
and %s13, %s13, (32)0
lea.sl %s11, -1(%s13, %s11)

Now:

lea %s13, -240
and %s13, %s13, (32)0
lea.sl %s11, -2(%s13, %s11)
This revision was landed with ongoing or failed builds.Nov 20 2020, 11:08 PM
This revision was automatically updated to reflect the committed changes.