Skip to content

Commit 2743fc0

Browse files
committed
Guards: Include ConditionalExpr in exprHasValue.
1 parent e8f1ec6 commit 2743fc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

shared/controlflow/codeql/controlflow/Guards.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,10 @@ module Make<
773773
or
774774
exprHasValue(e.(IdExpr).getEqualChildExpr(), v)
775775
or
776+
exists(ConditionalExpr cond | cond = e |
777+
exprHasValue(cond.getThen(), v) and exprHasValue(cond.getElse(), v)
778+
)
779+
or
776780
exists(SsaDefinition def, Guard g, GuardValue gv |
777781
e = def.getARead() and
778782
g.directlyValueControls(e.getBasicBlock(), gv) and

0 commit comments

Comments
 (0)