mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Ruby: CFG: make Completion.isValidFor work for getSugared AST nodes
This commit is contained in:
@@ -84,6 +84,8 @@ private predicate mayRaise(Call c) {
|
||||
abstract class Completion extends TCompletion {
|
||||
/** Holds if this completion is valid for node `n`. */
|
||||
predicate isValidFor(AstNode n) {
|
||||
exists(AstNode other | n = other.getDesugared() and this.isValidFor(other))
|
||||
or
|
||||
this = n.(NonReturningCall).getACompletion()
|
||||
or
|
||||
completionIsValidForStmt(n, this)
|
||||
@@ -229,8 +231,6 @@ private predicate inMatchingContext(AstNode n) {
|
||||
or
|
||||
n = any(VariableReferencePattern p).getVariableAccess()
|
||||
or
|
||||
n = any(CasePattern c).getDesugared()
|
||||
or
|
||||
n.(Trees::DefaultValueParameterTree).hasDefaultValue()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user