Skip to content

Commit 3689481

Browse files
committed
Ruby: CFG: make Completion.isValidFor work for getSugared AST nodes
1 parent 660e52f commit 3689481

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ private predicate mayRaise(Call c) {
8484
abstract class Completion extends TCompletion {
8585
/** Holds if this completion is valid for node `n`. */
8686
predicate isValidFor(AstNode n) {
87+
exists(AstNode other | n = other.getDesugared() and this.isValidFor(other))
88+
or
8789
this = n.(NonReturningCall).getACompletion()
8890
or
8991
completionIsValidForStmt(n, this)
@@ -229,8 +231,6 @@ private predicate inMatchingContext(AstNode n) {
229231
or
230232
n = any(VariableReferencePattern p).getVariableAccess()
231233
or
232-
n = any(CasePattern c).getDesugared()
233-
or
234234
n.(Trees::DefaultValueParameterTree).hasDefaultValue()
235235
}
236236

0 commit comments

Comments
 (0)