WASM: Implement finally blocks for try/catch'es

This commit is contained in:
Igor Laevsky
2021-09-02 18:55:11 +03:00
committed by TeamCityServer
parent d99473fe4d
commit 4299915326
4 changed files with 38 additions and 13 deletions
@@ -217,7 +217,7 @@ class FinallyBlocksLowering(val context: CommonBackendContext, private val throw
val syntheticTry = IrTryImpl(
startOffset = startOffset,
endOffset = endOffset,
type = context.irBuiltIns.unitType
type = context.irBuiltIns.nothingType
).apply {
this.catches += irCatch(
catchParameter,
@@ -241,7 +241,7 @@ class FinallyBlocksLowering(val context: CommonBackendContext, private val throw
val transformedTry = IrTryImpl(
startOffset = startOffset,
endOffset = endOffset,
type = context.irBuiltIns.unitType
type = context.irBuiltIns.nothingType
)
transformedTry.tryResult = returnedResult
for (aCatch in aTry.catches) {