[WebAssembly] Fix LowerEmscriptenEHSjLj when there's only longjmp
ClosedPublic

Authored by aheejin on Thu, Nov 8, 1:34 PM.

Details

Summary

The pass incorrectly assumed if there's a longjmp declaration in the
module, there is also a setjmp function declaration. Fixed it, and now
the pass only converts longjmp and does not do any other transformation
when there's no setjmp declaration in the module.

Fixes PR39562.

Diff Detail

Repository
rL LLVM
aheejin created this revision.Thu, Nov 8, 1:34 PM
aheejin edited the summary of this revision. (Show Details)Thu, Nov 8, 1:35 PM
aheejin added inline comments.Thu, Nov 8, 1:37 PM
lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
211 ↗(On Diff #173217)

Indentation fix after renumbering comments

And the previous code actually failed without -s WASM_OBJECT_FILES=1 too.

sbc100 accepted this revision.Thu, Nov 8, 1:58 PM

Nice!

This revision is now accepted and ready to land.Thu, Nov 8, 1:58 PM
jgravelle-google accepted this revision.Thu, Nov 8, 1:59 PM
aheejin edited the summary of this revision. (Show Details)Thu, Nov 8, 2:24 PM
This revision was automatically updated to reflect the committed changes.