UndertaleModTool icon indicating copy to clipboard operation
UndertaleModTool copied to clipboard

Break/continue statements generated by compiler sometimes work erroneously

Open colinator27 opened this issue 3 years ago • 1 comments

Break/continue statements produced by the GML compiler sometimes erroneously apply to an outer with/switch statement. Example in the following code:

with (any_instance_here)
{
    a = 1
    for (var i = 0; i < 10; i++)
    {
        if (a == 1)
            break
    }
    // This line will never run:
    a = 123
}

This is due to the otherContexts structure existing. In order to fix this problem, otherContexts and loopContexts need to get merged into one stack. This shouldn't be too difficult to do.

colinator27 avatar Apr 14 '22 15:04 colinator27

Is this related in any way to #191 ?

Miepee avatar Jun 20 '22 13:06 Miepee