Storyyeller / Krakatau

Java decompiler, assembler, and disassembler
GNU General Public License v3.0
1.97k stars 220 forks source link

assembler error with .const Long #53

Closed skochinsky closed 8 years ago

skochinsky commented 8 years ago

I think current code is not completely ready to handle two-slot consts (long/double). See this sample. Stack trace:

Traceback (most recent call last):
  File "Krakatau\assemble.py", line 47, in <module>
    pairs = assembleClass(log, target, args.g, args.jas, args.d)
  File "Krakatau\assemble.py", line 23, in assembleClass
    return parse_trees and [assembler.assemble(tree, makeLineNumbers, jasmode, basename) for tree in parse_trees]
  File "Krakatau\Krakatau\assembler\assembler.py", line 528, in assemble
    addLdcRefs(top_d['method'], pool)
  File "Krakatau\Krakatau\assembler\assembler.py", line 441, in addLdcRefs
    assert(not slots)
AssertionError
skochinsky commented 8 years ago

BTW, I tried using ldc NNL and it didn't work either:

Syntax error at line 8571: unexpected token u'-9223372036854775808L'
Expected: INT_LITERAL, CPINDEX, STRING_LITERAL, FLOAT_LITERAL
Found: LONG_LITERAL
Storyyeller commented 8 years ago

I'm working on a complete rewrite of the assembler, so I'm not going to bother looking into this. I'll just make sure that it works in the new version. Thanks for reporting it anyway.