Closed samczsun closed 7 years ago
It looks like the issue is that you are using a reserved opcode, which violates the JVM specification.
Only instances of the instructions documented in
§6.5
may appear in the
code
array. Instances of instructions using the reserved opcodes (
§6.2
) or any opcodes
not documented in this specification must not appear in the
code
array.
Sadly, the JVM doesn't appear to enforce this. Any ideas what I should do?
Oh, I see what you did - you put a Code attribute on the class. I'm surprised that passes verification, but at least it's a separate issue.
As a quick workaround, I modified it to ignore Code attributes that aren't inside a method. But this obviously doesn't solve the underlying issue. I think it will take some time to investigate which attributes are actually allowed where.
By modding my copy of Krakatau, I was able to assemble this:
Java executes this file (even under
-Xverify:all
!), but Krakatau has a hard time disassembling it:The class file has been attached (renamed to .txt)
Test.txt