exception-handling icon indicating copy to clipboard operation
exception-handling copied to clipboard

is opcode of catch being 0x00?

Open trcrsired opened this issue 1 year ago • 3 comments

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?

trcrsired avatar Feb 11 '24 11:02 trcrsired

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".

titzer avatar Feb 12 '24 16:02 titzer

so it is like

try_table catch 0x1f 0x00

?

trcrsired avatar Feb 13 '24 10:02 trcrsired

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

yamt avatar Feb 16 '24 04:02 yamt