Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is opcode of catch being 0x00? #294

Open
trcrsired opened this issue Feb 11, 2024 · 3 comments
Open

is opcode of catch being 0x00? #294

trcrsired opened this issue Feb 11, 2024 · 3 comments

Comments

@trcrsired
Copy link

trcrsired commented Feb 11, 2024

actch | 0x00 | tag : varuint32, label : varuint32
catch_ref | 0x01 | tag : varuint32, label : varuint32
catch_all | 0x02 | label : varuint32
catch_all_ref | 0x03 | label : varuint32

https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md
It looks quite weird why the opcode of catch is 0x00. How does that work?

@titzer
Copy link
Contributor

titzer commented Feb 12, 2024

Catches are part of try_table; in fact, they are actually immediates of a try_table instruction, so they don't have a separate "opcode".

@trcrsired
Copy link
Author

so it is like

try_table catch
0x1f 0x00

?

@yamt
Copy link
Contributor

yamt commented Feb 16, 2024

so it is like

try_table catch 0x1f 0x00

?

try_table(1f) blocktype count catch(00) tag label

see https://webassembly.github.io/exception-handling/core/binary/instructions.html#control-instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants