From 2e78a1cd9088b3368736aef85144c9d26124656a Mon Sep 17 00:00:00 2001 From: Igor Yakovlev Date: Tue, 23 Nov 2021 17:12:08 +0100 Subject: [PATCH] [WASM] Fix invalid string literal encoding --- .../org/jetbrains/kotlin/backend/wasm/ir2wasm/ConstantData.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/ConstantData.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/ConstantData.kt index be67f2684a6..2c6060dd5ac 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/ConstantData.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/ir2wasm/ConstantData.kt @@ -102,5 +102,5 @@ fun Int.toLittleEndianBytes(): ByteArray { } fun Char.toLittleEndianBytes(): ByteArray { - return byteArrayOf((this.code and 0xFF).toByte(), (this.code and 0xFF00).toByte()) + return byteArrayOf((this.code and 0xFF).toByte(), (this.code ushr Byte.SIZE_BITS).toByte()) } \ No newline at end of file