mirror of
https://github.com/github/codeql.git
synced 2026-04-22 07:15:15 +02:00
Fix uses of ConditionBlock that require a condition expression (not a switch case statement)
This commit is contained in:
@@ -460,7 +460,7 @@ private predicate interestingCond(SsaSourceVariable npecand, ConditionBlock cond
|
||||
varMaybeNullInBlock(_, npecand, cond, _) or
|
||||
varConditionallyNull(npecand.getAnSsaVariable(), cond, _)
|
||||
) and
|
||||
not cond.getCondition().getAChildExpr*() = npecand.getAnAccess()
|
||||
not cond.getCondition().(Expr).getAChildExpr*() = npecand.getAnAccess()
|
||||
}
|
||||
|
||||
/** A pair of correlated conditions for a given NPE candidate. */
|
||||
@@ -588,7 +588,7 @@ private predicate trackingVar(
|
||||
exists(ConditionBlock cond |
|
||||
interestingCond(npecand, cond) and
|
||||
varMaybeNullInBlock(_, npecand, cond, _) and
|
||||
cond.getCondition().getAChildExpr*() = trackvar.getAnAccess() and
|
||||
cond.getCondition().(Expr).getAChildExpr*() = trackvar.getAnAccess() and
|
||||
trackssa.getSourceVariable() = trackvar and
|
||||
trackssa.getDefiningExpr().(VariableAssign).getSource() = init
|
||||
|
|
||||
|
||||
Reference in New Issue
Block a user