mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Kotlin: Fix handling of non-true conditions
This commit is contained in:
@@ -930,9 +930,12 @@ private module ControlFlowGraphImpl {
|
||||
or
|
||||
exists(WhenBranch whenbranch | whenbranch = n |
|
||||
// If the condition completes with anything other than true
|
||||
// (e.g. false or an exception), then the branch is done
|
||||
// (or "normal", which we will also see if we don't know how
|
||||
// to make specific true/false edges for the condition)
|
||||
// (e.g. false or an exception), then the branch is done.
|
||||
last(whenbranch.getCondition(), last, completion) and
|
||||
completion != BooleanCompletion(true, _)
|
||||
not completion = BooleanCompletion(true, _) and
|
||||
not completion = NormalCompletion()
|
||||
or
|
||||
// Otherwise we wrap the completion up in a YieldCompletion
|
||||
// so that the `when` expression can tell that we have finished,
|
||||
|
||||
Reference in New Issue
Block a user