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 {
870870 * including those inherited from ancestors.
871871 */
872872 ParameterNode getAnInstanceSelf ( ) {
873- result = TSelfParameterNode ( this .getAnInstanceMethod ( ) .asMethod ( ) )
873+ // Make sure to include the 'self' in overridden instance methods
874+ result = this .getAnAncestor ( ) .getAnOwnInstanceSelf ( )
874875 }
875876
876877 private InstanceVariableAccess getAnOwnInstanceVariableAccess ( string name ) {
@@ -906,14 +907,18 @@ class ModuleNode instanceof Module {
906907 /**
907908 * Gets the instance method named `name` available in this module, including methods inherited
908909 * from ancestors.
910+ *
911+ * Overridden methods are not included.
909912 */
910913 MethodNode getInstanceMethod ( string name ) {
911914 result .asCallableAstNode ( ) = super .getInstanceMethod ( name )
912915 }
913916
914917 /**
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
916919 * from ancestors.
920+ *
921+ * Overridden methods are not included.
917922 */
918923 MethodNode getAnInstanceMethod ( ) { result = this .getInstanceMethod ( _) }
919924
You can’t perform that action at this time.
0 commit comments