mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Fix WhenExpr flow
This commit is contained in:
committed by
Ian Lynagh
parent
5979981199
commit
9735423c79
@@ -1248,7 +1248,7 @@ private module ControlFlowGraphImpl {
|
||||
)
|
||||
or
|
||||
// When expressions:
|
||||
exists(WhenExpr whenexpr | n = whenexpr |
|
||||
exists(WhenExpr whenexpr |
|
||||
n = whenexpr and
|
||||
result = first(whenexpr.getBranch(0)) and
|
||||
completion = NormalCompletion()
|
||||
|
||||
@@ -156,6 +156,8 @@ predicate simpleLocalFlowStep(Node node1, Node node2) {
|
||||
or
|
||||
node2.asExpr() = any(NotNullExpr nne | node1.asExpr() = nne.getExpr())
|
||||
or
|
||||
node2.asExpr().(WhenExpr).getBranch(_).getAResult() = node1.asExpr()
|
||||
or
|
||||
exists(MethodAccess ma, ValuePreservingMethod m, int argNo |
|
||||
ma.getCallee().getSourceDeclaration() = m and m.returnsValue(argNo)
|
||||
|
|
||||
|
||||
Reference in New Issue
Block a user