Skip to content

Commit 85adb81

Browse files
committed
Add test for FP result when read is unreachable
1 parent c7f49f2 commit 85adb81

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| main.go:36:9:36:9 | undefined: unknownFunction |
1+
| main.go:41:9:41:9 | undefined: unknownFunction |

‎go/ql/test/query-tests/RedundantCode/DeadStoreOfLocal/main.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func deadParameter(x int) bool { // we don't want to flag x here
2626
return true
2727
}
2828

29+
func usedOnlyAfterFalse() bool {
30+
s := deadStore() // $ SPURIOUS: Alert
31+
return false && s == 0
32+
}
33+
2934
func test2(x int) (int, int) {
3035
y := x >> 5
3136
z := x % (1)

0 commit comments

Comments
 (0)