IDE (Editor) - "Jump to..." incorrect branch selected

From Liberty BASIC Family
Jump to navigation Jump to search

Description

Using the Jump List to jump to a branch, which is present multiple times in different procedures, always jumps to the last branch of that name.

Example code to demonstrate the bug.

Select one of the [Error] branches of one of the first two procedures and notice you are always ending up in the last procedure.

    call Hi
    End

Sub Hi
    On Error GoTo [Error]
    Print "Hello World!!"
    Exit Sub
[Error]
    ' put error handling here
End Sub

Function Dummy1()
    On Error GoTo [Error]
    ' do something
    Exit Function
[Error]
    ' put error handling here
End Function

Function Dummy2()
    On Error GoTo [Error]
    ' do something
    Exit Function
[Error]
    ' put error handling here
End Function

Example code to work around the bug.

Use branches of different names throughout the whole program despite of being located inside a procedure or not.

    call Hi
    End

Sub Hi
    On Error GoTo [Error1]
    Print "Hello World!!"
    Exit Sub
[Error1]
    ' put error handling here
End Sub

Function Dummy1()
    On Error GoTo [Error2]
    ' do something
    Exit Function
[Error2]
    ' put error handling here
End Function

Function Dummy2()
    On Error GoTo [Error3]
    ' do something
    Exit Function
[Error3]
    ' put error handling here
End Function