This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Handle _setjmp and _longjmp in SjLj
ClosedPublic

Authored by aheejin on Sep 12 2021, 7:16 PM.

Details

Summary

In some platforms _setjmp and _longjmp are used instead of setjmp
and longjmp. This CL adds support for them.

Fixes https://github.com/emscripten-core/emscripten/issues/14999.

Diff Detail

Event Timeline

aheejin created this revision.Sep 12 2021, 7:16 PM
aheejin requested review of this revision.Sep 12 2021, 7:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2021, 7:16 PM
aheejin edited the summary of this revision. (Show Details)Sep 12 2021, 7:19 PM
aheejin added inline comments.Sep 13 2021, 2:00 PM
llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
838

I wanted to name these variable _SetjmpF of SetjmpF, but clang-tidy didn't like it...

838

Oh, I mean, _SetjmpF of SetjmpF_ (the same for longjmp)

dschuff accepted this revision.Sep 13 2021, 2:14 PM

otherwise LGTM

llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
841

Is there any way this can happen other than an LLVM bug (e.g. a library problem, or a user's function being used instead of a library function, etc)? If so, it should probably be a fatal error instead of an assert.

This revision is now accepted and ready to land.Sep 13 2021, 2:14 PM
aheejin updated this revision to Diff 372344.Sep 13 2021, 2:20 PM
aheejin marked an inline comment as done.

Change to report_fatal_error

This revision was landed with ongoing or failed builds.Sep 13 2021, 2:46 PM
This revision was automatically updated to reflect the committed changes.