mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
simplify expressions that could be type-casts
This commit is contained in:
@@ -30,8 +30,8 @@ where
|
||||
// the next statement isn't breaking out of a switch
|
||||
not s.(BreakStmt).getBreakable() instanceof SwitchStmt and
|
||||
// the next statement isn't a loop that can be jumped into
|
||||
not exists(LabelStmt ls | s.(Loop).getStmt().getAChild*() = ls) and
|
||||
not exists(SwitchCase sc | s.(Loop).getStmt().getAChild*() = sc) and
|
||||
not s.(Loop).getStmt().getAChild*() instanceof LabelStmt and
|
||||
not s.(Loop).getStmt().getAChild*() instanceof SwitchCase and
|
||||
// no preprocessor logic applies
|
||||
not functionContainsPreprocCode(js.getEnclosingFunction())
|
||||
select js, "This statement makes $@ unreachable.", s, s.toString()
|
||||
|
||||
Reference in New Issue
Block a user