[Wasm] Add compiler flag to disable exception handling proposal

Fail with unreachable instead of throwing an exception

Merge-request: KT-MR-11481
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
This commit is contained in:
Svyatoslav Kuzmich
2023-08-07 16:19:29 +00:00
committed by Space Team
parent ec73815f80
commit 47ade4530c
17 changed files with 118 additions and 13 deletions
@@ -123,9 +123,11 @@ class WasmIrToBinary(
}
// tag section
appendSection(WasmBinary.Section.TAG) {
appendVectorSize(tags.size)
tags.forEach { appendTag(it) }
if (tags.isNotEmpty()) {
appendSection(WasmBinary.Section.TAG) {
appendVectorSize(tags.size)
tags.forEach { appendTag(it) }
}
}
appendSection(WasmBinary.Section.GLOBAL) {
@@ -607,7 +609,7 @@ abstract class ByteWriter {
fun writeUByte(v: UByte) {
writeByte(v.toByte())
}
fun writeUInt32(v: UInt) {
writeByte(v.toByte())
writeByte((v shr 8).toByte())