CommandHelper

CommandHelper

46.5k Downloads

Compiler/Optimizer crash on certain optimizations after die()

LadyCailinBot opened this issue ยท 1 comments

commented

CMDHELPER-2849 - Reported by CyaNox

The following code:
{code:title=test.ms}
die()
@test2 = @test


produced the following crash:

java -jar commandhelper-3.3.1-SNAPSHOT.jar optimizer-test test.ms
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.laytonsmith.core.functions.Compiler$autoconcat.optimizeSpecial(Compiler.java:220)
at com.laytonsmith.core.functions.Compiler$autoconcat.optimizeDynamic(Compiler.java:125)
at com.laytonsmith.core.MethodScriptCompiler.optimize(MethodScriptCompiler.java:1377)
at com.laytonsmith.core.MethodScriptCompiler.compile(MethodScriptCompiler.java:1171)
at com.laytonsmith.core.compiler.OptimizationUtilities.optimize(OptimizationUtilities.java:51)
at com.laytonsmith.core.Main.main(Main.java:310)

commented

Comment by LadyCailin

Looks like the key to reproducing this is to have multiple symbols after a terminal function. Anyways, this is fixed in the next build.