mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Kotlin: Exclude captured variables from constant loop condition check
This commit is contained in:
@@ -7,4 +7,18 @@ fun fn1() {
|
||||
c = false
|
||||
}
|
||||
}
|
||||
|
||||
var d = true
|
||||
while (d) { // FALSE NEGATIVE
|
||||
fn0 {
|
||||
println(d)
|
||||
}
|
||||
}
|
||||
|
||||
val e = true
|
||||
while (e) {
|
||||
fn0 {
|
||||
println(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
| A.kt:5:12:5:12 | c | $@ might not terminate, as this loop condition is constant within the loop. | A.kt:5:5:9:5 | while (...) | Loop |
|
||||
| A.kt:19:12:19:12 | e | $@ might not terminate, as this loop condition is constant within the loop. | A.kt:19:5:23:5 | while (...) | Loop |
|
||||
|
||||
Reference in New Issue
Block a user