diff --git a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll index 37658c3d64b..b37af98d2c6 100644 --- a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -377,12 +377,9 @@ module Trees { private class ClassTree extends RescueEnsureBlockTree, Class { final override AstNode getChildNode(int i, boolean rescuable) { - rescuable = true and - ( - result = this.getName() and i = 0 - or - result = this.getChild(i - 1) - ) + result = this.getName() and i = 0 and rescuable = false + or + result = this.getChild(i - 1) and rescuable = true } } @@ -824,12 +821,9 @@ module Trees { private class ModuleTree extends RescueEnsureBlockTree, Module { final override AstNode getChildNode(int i, boolean rescuable) { - rescuable = true and - ( - result = this.getName() and i = 0 - or - result = this.getChild(i - 1) - ) + result = this.getName() and i = 0 and rescuable = false + or + result = this.getChild(i - 1) and rescuable = true } } @@ -1229,7 +1223,7 @@ module Trees { final override AstNode getChildNode(int i, boolean rescuable) { result = this.getObject() and i = 0 and - rescuable = true // TODO: CHECK THIS + rescuable = false or result = this.getParameters() and i = 1 and