This is an archive of the discontinued LLVM Phabricator instance.

[WebAssemblly] Fix EHPadStack update in fixCallUnwindMismatches
ClosedPublic

Authored by aheejin on Feb 15 2021, 7:37 AM.

Details

Summary

Updating EHPadStack with respect to TRY and CATCH instructions
have to be done after checking all other conditions, not before. Because
we did this before checking other conditions, when we encounter TRY
and we want to record the current mismatching range, we already have
popped up the entry from EHPadStack, which we need to access to record
the range.

The baz call in the added test needs try-delegate because the previous
TRY marker placement for quux was placed before baz, because baz's
return value was stackified in RegStackify. If this wasn't stackified
this try-delegate is not strictly necessary, but at the moment it is not
easy to identify cases like this. I plan to transfer nounwind
attributes from the LLVM IR to prevent cases like this. The call in the
test does not have unwind attribute in order to test this bug, but in
many cases of this pattern the previous call has nounwind attribute.

Diff Detail

Event Timeline

aheejin created this revision.Feb 15 2021, 7:37 AM
aheejin requested review of this revision.Feb 15 2021, 7:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2021, 7:37 AM
aheejin edited the summary of this revision. (Show Details)Feb 17 2021, 9:36 AM
tlively accepted this revision.Feb 17 2021, 11:56 AM
This revision is now accepted and ready to land.Feb 17 2021, 11:56 AM