File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
ruby/ql/lib/codeql/ruby/dataflow/internal Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -870,7 +870,8 @@ class ModuleNode instanceof Module {
870
870
* including those inherited from ancestors.
871
871
*/
872
872
ParameterNode getAnInstanceSelf ( ) {
873
- result = TSelfParameterNode ( this .getAnInstanceMethod ( ) .asMethod ( ) )
873
+ // Make sure to include the 'self' in overridden instance methods
874
+ result = this .getAnAncestor ( ) .getAnOwnInstanceSelf ( )
874
875
}
875
876
876
877
private InstanceVariableAccess getAnOwnInstanceVariableAccess ( string name ) {
@@ -906,14 +907,18 @@ class ModuleNode instanceof Module {
906
907
/**
907
908
* Gets the instance method named `name` available in this module, including methods inherited
908
909
* from ancestors.
910
+ *
911
+ * Overridden methods are not included.
909
912
*/
910
913
MethodNode getInstanceMethod ( string name ) {
911
914
result .asCallableAstNode ( ) = super .getInstanceMethod ( name )
912
915
}
913
916
914
917
/**
915
- * Gets an instance method named available in this module, including methods inherited
918
+ * Gets an instance method available in this module, including methods inherited
916
919
* from ancestors.
920
+ *
921
+ * Overridden methods are not included.
917
922
*/
918
923
MethodNode getAnInstanceMethod ( ) { result = this .getInstanceMethod ( _) }
919
924
You can’t perform that action at this time.
0 commit comments