0

So I have a classes containing bytecode I need to debug ...

Using asmtools' jdis gives me editable bytecode that I then can reassemble using jasm.

Or at least I can MOST of the time.

For this particular class, though, I can disassemble it just fine. If I do nothing to the file and instead immediately try to reassemble it, jasm will claim

Error: class file version expected

on 69 occasions, most of which seem to be at a local_map or invokestatic instruction, though there are also a few at istore or iconst_1 instructions.

I'd say that's an unnecessary check gone haywire. After all, I do have a .class file that runs just fine (except that it's giving me a ClassCastException where there shouldn't be one, but that won't corrupt bytecode).

Can I somehow turn that off?

User1291
  • 7,664
  • 8
  • 51
  • 108
  • 1
    This looks like a parser error, as the message doesn’t indicate that it is actually checking a class file version but *expecting* the declaration of a version. For simple parsers, this often indicates that whatever it has found was unexpected, but generating useful error messages just given the rule set and input, is a different science. Sometimes, it’s just a single brace missing or too much, to confuse a parser. – Holger Apr 03 '18 at 11:51
  • Have you tried using Krakatau? It has much better error messages. (As well as not having this bug in the first place) – Antimony Apr 03 '18 at 14:07

0 Answers0