asmble icon indicating copy to clipboard operation
asmble copied to clipboard

asmble compile error

Open DreamWuGit opened this issue 5 years ago • 4 comments

I download 0.4.0 release ,and extract to my computer . when I run : MacBook-Pro:asmble wudream$ ./asmble/bin/asmble compile main.wasm hello
Exception in thread "main" kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Function 'limit' (JVM signature: limit(I)Ljava/nio/Buffer;) not resolved in class java.nio.ByteBuffer: public open fun limit(arg0: kotlin.Int): (java.nio.ByteBuffer..java.nio.ByteBuffer?) defined in java.nio.ByteBuffer | kotlin.reflect.jvm.internal.JvmFunctionSignature$JavaMethod@f19c9d2 public final fun limit(): kotlin.Int defined in java.nio.ByteBuffer | kotlin.reflect.jvm.internal.JvmFunctionSignature$JavaMethod@7807ac2c at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.findFunctionDescriptor(KDeclarationContainerImpl.kt:159) at kotlin.reflect.jvm.internal.KFunctionImpl$descriptor$2.invoke(KFunctionImpl.kt:54) at kotlin.reflect.jvm.internal.KFunctionImpl$descriptor$2.invoke(KFunctionImpl.kt:34) at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92) at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31) at kotlin.reflect.jvm.internal.KFunctionImpl.getDescriptor(KFunctionImpl.kt) at kotlin.reflect.jvm.internal.KFunctionImpl$caller$2.invoke(KFunctionImpl.kt:60) at kotlin.reflect.jvm.internal.KFunctionImpl$caller$2.invoke(KFunctionImpl.kt:34) at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92) at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31) at kotlin.reflect.jvm.internal.KFunctionImpl.getCaller(KFunctionImpl.kt) at kotlin.reflect.jvm.ReflectJvmMapping.getJavaMethod(ReflectJvmMapping.kt:62) at asmble.compile.jvm.AsmExtKt.getDeclarer(AsmExt.kt:22) at asmble.compile.jvm.AsmExtKt.invokeVirtual(AsmExt.kt:28) at asmble.compile.jvm.ByteBufferMem.init(ByteBufferMem.kt:27) at asmble.compile.jvm.AstToAsm.addMemClassConstructor(AstToAsm.kt:146) at asmble.compile.jvm.AstToAsm.addConstructors(AstToAsm.kt:79) at asmble.compile.jvm.AstToAsm.fromModule(AstToAsm.kt:26) at asmble.cli.Compile.run(Compile.kt:71) at asmble.cli.Compile.run(Compile.kt:10) at asmble.cli.Command.runWithArgs(Command.kt:17) at asmble.cli.MainKt.main(Main.kt:31)

I do quick glance at google search , it seems to be java.nio.ByteBuffer incompatibility with JDK9+ . https://github.com/eclipse/jetty.project/issues/3244 pls. have a look !

DreamWuGit avatar Mar 06 '19 09:03 DreamWuGit

supplement : I both installed java JDK8 and JDK10 , 10 is supposed to be default .

DreamWuGit avatar Mar 06 '19 09:03 DreamWuGit

I ran into this issue as well. Removing JDK9 and 10 and installing JDK8 solved it for me.

lrettig avatar May 12 '19 17:05 lrettig

It's caused by an error here: https://github.com/cretz/asmble/blob/73862e9bc98c1ed61bd59cf6c25d2b6258667ed9/compiler/src/main/kotlin/asmble/compile/jvm/ByteBufferMem.kt#L27

ice1000 avatar Sep 09 '19 20:09 ice1000

Created a PR #31 to fix this issue. Why didn't you guys fix this? This little bug is easy to spot.

ice1000 avatar Sep 09 '19 21:09 ice1000