Too many string concatenations lead to IllegalArgumentException

Create issue
Issue #43 duplicate
mezzodrinker created an issue

When a function contains more than 126 string concatenations, the following error will be thrown:

java.lang.IllegalArgumentException: Stack size exceeds maximum 256
    at net.mobtalker.mobtalkerscript.v3.MtsFunctionPrototype.<init>(
    at net.mobtalker.mobtalkerscript.v3.compiler.FunctionState.createPrototype(
    at net.mobtalker.mobtalkerscript.v3.compiler.MtsCompiler.compile(
    at net.mobtalker.mobtalkerscript.v3.compiler.MtsCompiler.loadChunk(
    at net.mobtalker.mobtalkerscript.v3.compiler.MtsCompiler.loadFile(
    at net.mobtalker.mobtalkerscript.v3.compiler.MtsCompiler.loadFile(
    at net.mobtalker.mobtalkerscript.standalone.MobTalkerScript.main(

The number after “Stack size exceeds maximum” appears to depend on the actual number of string concatenations (and, likely, other parts of a script). The amount of string concatenations appears to be constant and independent of how nested the chunk is.

Originally reported here.

Comments (5)

  1. Log in to comment