Makopo/lslint

Warn for labels with the same name in the same function

Closed this issue · 0 comments

In LSO, the jump goes to the last label always, even if there's just one jump (there's already a warning when there are multiple jump instructions):

jump x;
@x;
llOwnerSay("You can't see me");
if (0)
{
    @x; // this label is not in scope for the above jump, yet it's where it jumps
    llOwnerSay("oops!");
}

But in Mono it's even worse: you can't even SAVE the script. Not just compile but save.

So, detect that situation and emit a warning or error. Which one is preferable?