File tree 2 files changed +6
-5
lines changed
src/main/kotlin/xyz/wagyourtail/unimined/expect
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
kotlin.code.style =official
2
2
3
- version = 1.0.0
3
+ version = 1.0.1
4
4
5
5
asmVersion =9.7
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import org.objectweb.asm.tree.*
5
5
import xyz.wagyourtail.unimined.expect.utils.toByteArray
6
6
import java.nio.file.Path
7
7
import kotlin.io.path.*
8
-
8
+ import kotlin.math.max
9
9
10
10
class TransformPlatform (val platformName : String ) {
11
11
@@ -53,11 +53,11 @@ class TransformPlatform(val platformName: String) {
53
53
}
54
54
55
55
@Suppress(" UNCHECKED_CAST" )
56
- val platforms = annotation.values[1 ] as List <AnnotationNode >
56
+ val platforms = annotation.values[1 ] as ? List <AnnotationNode >
57
57
58
58
var platformClass: String? = null
59
59
60
- for (platform in platforms) {
60
+ for (platform in platforms ? : emptyList() ) {
61
61
val name = platform.values[1 ] as String
62
62
val clazz = platform.values[3 ] as String
63
63
if (name == platformName) {
@@ -86,7 +86,8 @@ class TransformPlatform(val platformName: String) {
86
86
)
87
87
method.instructions.add(InsnNode (type.returnType.getOpcode(Opcodes .IRETURN )))
88
88
89
- method.maxStack = - 1
89
+ method.maxStack = max(type.returnType.size, stackIndex)
90
+ method.maxLocals = stackIndex
90
91
}
91
92
92
93
private fun platformOnly (method : MethodNode , classNode : ClassNode , annotation : AnnotationNode ) {
You can’t perform that action at this time.
0 commit comments