Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect when On Error statement refers to a LineLabel defined above #422

Open
retailcoder opened this issue Apr 29, 2015 · 0 comments
Open
Labels
code-path-analysis Involves simulating execution paths / interpreting the user code ..to an extent. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections

Comments

@retailcoder
Copy link
Member

This code is legal, but certainly doesn't produce the expected results:

Public Sub DoSomething
    ErrHandler:
        Err.Clear

    On Error GoTo ErrHandler
    'code
End Sub

yes, people have done that

Since we now pick up LineLabel declarations, we can easily inspect OnError statements and locate instances where the OnError statement is pointing to a LineLabel that's declared above it.. which is clearly a bug waiting to happen.

@retailcoder retailcoder added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections labels Apr 29, 2015
@retailcoder retailcoder added the code-path-analysis Involves simulating execution paths / interpreting the user code ..to an extent. label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-path-analysis Involves simulating execution paths / interpreting the user code ..to an extent. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections
Projects
None yet
Development

No branches or pull requests

1 participant