summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc.c2
-rw-r--r--test/ruby/test_method.rb13
-rw-r--r--version.h8
3 files changed, 18 insertions, 5 deletions
diff --git a/proc.c b/proc.c
index d3d75cb29f..fc1fdf7b3a 100644
--- a/proc.c
+++ b/proc.c
@@ -2781,7 +2781,7 @@ method_super_method(VALUE method)
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
iclass = data->iclass;
if (!iclass) return Qnil;
- if (data->me->def->type == VM_METHOD_TYPE_ALIAS) {
+ if (data->me->def->type == VM_METHOD_TYPE_ALIAS && data->me->defined_class) {
super_class = RCLASS_SUPER(rb_find_defined_class_by_owner(data->me->defined_class,
data->me->def->body.alias.original_me->owner));
mid = data->me->def->body.alias.original_me->def->original_id;
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 1df09c21b7..3bf25928c9 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -1038,6 +1038,19 @@ class TestMethod < Test::Unit::TestCase
assert_nil(m.super_method)
end
+ # Bug 17780
+ def test_super_method_module_alias
+ m = Module.new do
+ def foo
+ end
+ alias :f :foo
+ end
+
+ method = m.instance_method(:f)
+ super_method = method.super_method
+ assert_nil(super_method)
+ end
+
def rest_parameter(*rest)
rest
end
diff --git a/version.h b/version.h
index c7eb06d030..31a7605f40 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.6.8"
-#define RUBY_RELEASE_DATE "2021-06-24"
-#define RUBY_PATCHLEVEL 200
+#define RUBY_RELEASE_DATE "2021-07-04"
+#define RUBY_PATCHLEVEL 201
#define RUBY_RELEASE_YEAR 2021
-#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 24
+#define RUBY_RELEASE_MONTH 7
+#define RUBY_RELEASE_DAY 4
#include "ruby/version.h"