Search code examples
flashactionscript-3stack-overflow

Why does calling this function with more than 2 parameters in Actionscript 3 cause stack overflow?


function testFunc(val1:int, val2:int, val3:int):int {
    var returnVal:int = 0;
    return returnVal;
}

var val:int = testFunc(1, 2, 3);

causes

locals: Main int int int * 
4:dup VerifyError: Error #1023: Stack overflow occurred.

Solution

  • This page discusses a similar stack overflow issue. It seems adding a trace somewhere in the function will fix it.

    It's a known bug