mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
simplify lastStatementHasNoEffect and use the control-flow to determine which statement is the last
This commit is contained in:
@@ -86,11 +86,7 @@ predicate alwaysThrows(Function f) {
|
||||
* Holds if the last statement in the function is flagged by the js/useless-expression query.
|
||||
*/
|
||||
predicate lastStatementHasNoEffect(Function f) {
|
||||
exists(DataFlow::Node noEffect |
|
||||
noEffect.getContainer() = f and
|
||||
hasNoEffect(noEffect.asExpr()) and
|
||||
not exists(noEffect.getASuccessor())
|
||||
)
|
||||
hasNoEffect(f.getExit().getAPredecessor())
|
||||
}
|
||||
|
||||
predicate callToVoidFunction(DataFlow::CallNode call, Function func) {
|
||||
|
||||
Reference in New Issue
Block a user