gobra icon indicating copy to clipboard operation
gobra copied to clipboard

Incorrect Encoding of break Stmt

Open ArquintL opened this issue 2 years ago • 1 comments

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 avatar Jan 18 '24 07:01 ArquintL

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

ArquintL avatar Jan 18 '24 08:01 ArquintL