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

Incorrect Encoding of break Stmt #719

Open
ArquintL opened this issue Jan 18, 2024 · 1 comment
Open

Incorrect Encoding of break Stmt #719

ArquintL opened this issue Jan 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working critical encoding

Comments

@ArquintL
Copy link
Member

The following program successfully verifies despite leading to an infinite loop at runtime, since break only escapes the switch statement but not the loop:

package test

decreases
func foo() {
    invariant i == 0
    decreases
    for i := 0; ; i++ {
        switch i {
            default:
                break
        }
    }
}
@ArquintL ArquintL added bug Something isn't working critical encoding labels Jan 18, 2024
@ArquintL ArquintL self-assigned this Jan 18, 2024
@ArquintL
Copy link
Member Author

Gobra incorrectly ignores the switch / select context of a break stmt and associates it with the surrounding loop

ArquintL added a commit that referenced this issue Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical encoding
Projects
None yet
Development

No branches or pull requests

1 participant