This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Error out on invalid personality functions
ClosedPublic

Authored by aheejin on Jun 5 2023, 3:22 PM.

Details

Summary

Without explicitly checking and erroring out, an invalid personality
function, which is not __gxx_wasm_personality_v0, caused
a segmentation fault down the line because WasmEHFuncInfo was not created.
This explicitly checks the validity of personality functions in
functions with EH pads and errors out explicitly with a helpful error
message. This also adds some more assertions to ensure WasmEHFuncInfo
is correctly created and non-null.

Invalid personality functions wouldn't be generated by our Clang, but
can be present in handwritten ll files, and more often, in files
transformed by passes like metarenamer, which is often used with
bugpoint to simplify names in bugpoint-reduced files.

Diff Detail

Event Timeline

aheejin created this revision.Jun 5 2023, 3:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 3:22 PM
Herald added subscribers: pmatos, asb, wingo and 4 others. · View Herald Transcript
aheejin requested review of this revision.Jun 5 2023, 3:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 3:22 PM
aheejin edited the summary of this revision. (Show Details)Jun 5 2023, 3:37 PM
dschuff accepted this revision.Jun 5 2023, 3:51 PM
This revision is now accepted and ready to land.Jun 5 2023, 3:51 PM
This revision was automatically updated to reflect the committed changes.