SquidDev / luaj.luajc

LuaJC ported to the ASM framework
Other
15 stars 0 forks source link

Issue in kristwallet #13

Closed Lignum closed 8 years ago

Lignum commented 8 years ago

In kristwallet, when you click around between the Transactions and Special TX tabs (try right clicking in the transactions panel a few times, too), eventually LuaJC will crash with a bytecode dump:

[ERROR] There was an error when compiling kristwallet.lua$35.
Please report this error message to http://github.com/SquidDev/luaj.luajc
proto '$35'

[lots of bytecode]

java.lang.RuntimeException: Method code too large!
    at org.objectweb.asm.MethodWriter.getSize(MethodWriter.java:2036)
    at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:827)
    at org.squiddev.luaj.luajc.compilation.JavaBuilder.completeClass(JavaBuilder.java:287)
    at org.squiddev.luaj.luajc.compilation.JavaGen.<init>(JavaGen.java:42)
    at org.squiddev.luaj.luajc.compilation.JavaLoader.include(JavaLoader.java:61)
    at org.squiddev.luaj.luajc.function.executors.ClosureExecutor.execute(ClosureExecutor.java:24)
        ...

Sometimes this makes the computer unusable, other times it'll act as if nothing happened.

SquidDev commented 8 years ago

The issue is that hud function is 3443 instructions long, which results in more than 64kb worth of Java bytecode and takes a long time to compile. Two things for me to fix: