Hi!
I'm having some trouble with jasmin. It seems to not jump when I want it to.
I have an if block that contains invalid code, but I expect the Java interpreter to jump past this block.
See this JVM code:
.class public Foo
.super java/lang/Object
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit locals 100
.limit stack 1000
iconst_0
ifeq L1 -- this should always branch?
iload 0 -- this results in runtime error
invokestatic Runtime/printInt(I)V
goto L0
L1:
bipush 42
invokestatic Runtime/printInt(I)V
L0:
return
.end method
When I compile it using Jasmin and run "java Foo", it complains that "Register 0 contains wrong type" because of "iload 0".
But shouldn't "ifeq L1" unconditionally jump? That is, shouldn't the above program work correctly?
Thanks in advance,
Niklas