Kray-G/kinx

Stack overflow by the operator of `=~` or `!~`.

Kray-G opened this issue · 1 comments

When using the operator of =~ or !~, the stack is not used cleanly.
It causes a stack overflow after a lot of operations by those operator like in a loop.

This should be also applied to v1.0.2 as a back port.

Here is the code to be reproduced. Stack has been overflowed when unmatched after resetting a string in Regex.

var l = "aaaaaaa";
for (var i = 0; i < 1000; ++i) {
    if (g = (l =~ /([b-z]+)/)) {
        System.println(g[1].string);
    } else if (g = (l =~ /([0-9]+)/)) {
        System.println(g[1].string);
    }
}
System.println("Successful");