From 6a130e03414eb9d3cca6bd4cfac50d1805553983 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 5 Dec 2020 20:09:42 +0800 Subject: [PATCH] Fix @ExpectPlatform for longs and doubles --- .../kotlin/me/shedaniel/architect/plugin/TransformExpect.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/me/shedaniel/architect/plugin/TransformExpect.kt b/src/main/kotlin/me/shedaniel/architect/plugin/TransformExpect.kt index b8e7dee..66595d7 100644 --- a/src/main/kotlin/me/shedaniel/architect/plugin/TransformExpect.kt +++ b/src/main/kotlin/me/shedaniel/architect/plugin/TransformExpect.kt @@ -32,7 +32,10 @@ fun transformExpectPlatform(): (ClassNode, (String, ByteArray) -> Unit) -> Class } else when (char) { '[' -> Unit 'L' -> inClass = true - else -> method.instructions.addLoad(char, index++) + else -> method.instructions.addLoad(char, when (char) { + 'J', 'D' -> index.also { index += 2 } + else -> index++ + }) } cursor++ }