WASM: Implement simple try/catch codegen
This commit is contained in:
committed by
TeamCityServer
parent
6ca965af6f
commit
02aed80e18
@@ -76,6 +76,12 @@ abstract class WasmExpressionBuilder {
|
||||
buildInstr(WasmOp.THROW, WasmImmediate.TagIdx(tagIdx))
|
||||
}
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun buildTry(label: String?, resultType: WasmType? = null) {
|
||||
numberOfNestedBlocks++
|
||||
buildInstr(WasmOp.TRY, WasmImmediate.BlockType.Value(resultType))
|
||||
}
|
||||
|
||||
fun buildCatch(tagIdx: Int) {
|
||||
buildInstr(WasmOp.CATCH, WasmImmediate.TagIdx(tagIdx))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user