mirror of
https://github.com/github/codeql.git
synced 2026-07-31 23:42:59 +02:00
Accept improved accuracy in redundant recover test
The test shouldn't have an alert because the panic happens before the deferred call to recover.
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
| RedundantRecover1.go:6:5:6:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | RedundantRecover1.go:5:1:9:1 | function declaration | the enclosing function |
|
||||
| RedundantRecover2.go:4:8:4:16 | call to recover | Deferred calls to 'recover' have no effect. | RedundantRecover2.go:3:1:6:1 | function declaration | the enclosing function |
|
||||
| tst.go:8:5:8:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | tst.go:5:1:11:1 | function declaration | the enclosing function |
|
||||
|
||||
@@ -5,7 +5,7 @@ import "fmt"
|
||||
func callRecover3() {
|
||||
// This will have no effect because panics do not propagate down the stack,
|
||||
// only back up the stack
|
||||
if recover() != nil { // $ Alert
|
||||
if recover() != nil {
|
||||
fmt.Printf("recovered")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user