From 59c83b7b8fabec61954af4eda93bd105f68a9551 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Thu, 29 Apr 2021 14:00:27 +0100 Subject: [PATCH] Add clarifying comment --- ql/src/codeql_ruby/ast/Call.qll | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ql/src/codeql_ruby/ast/Call.qll b/ql/src/codeql_ruby/ast/Call.qll index bc2231d94f3..e301a1b5b9d 100644 --- a/ql/src/codeql_ruby/ast/Call.qll +++ b/ql/src/codeql_ruby/ast/Call.qll @@ -162,6 +162,9 @@ private class RegularMethodCall extends MethodCall, TRegularMethodCall { not exists(g.getReceiver()) and toGenerated(result) = g.getMethod().(Generated::ScopeResolution).getScope() or + // If there's no explicit receiver (or scope resolution that acts like a + // receiver), then the receiver is implicitly `self`. N.B. `::Foo()` is + // not valid Ruby. not exists(g.getReceiver()) and not exists(g.getMethod().(Generated::ScopeResolution).getScope()) and result = TRegularMethodCallImplicitSelf(g)