зеркало из https://github.com/github/codeql.git
Fix `mayHaveSideEffects` for `ReturnStmt`
The previous code only worked when the return statement only has one returned expression.
This commit is contained in:
Родитель
2c500142c7
Коммит
d588ee375b
|
@ -569,7 +569,7 @@ class ReturnStmt extends @returnstmt, Stmt {
|
|||
/** Gets the unique returned expression, if there is only one. */
|
||||
Expr getExpr() { getNumChild() = 1 and result = getExpr(0) }
|
||||
|
||||
override predicate mayHaveSideEffects() { getExpr().mayHaveSideEffects() }
|
||||
override predicate mayHaveSideEffects() { getAnExpr().mayHaveSideEffects() }
|
||||
|
||||
override string toString() { result = "return statement" }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче