1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rb_class_real never returns Qnil

This commit is contained in:
Nobuyoshi Nakada 2020-10-09 01:21:10 +09:00
parent bca8952fc7
commit 6944b927bd
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

2
load.c
View file

@ -1234,7 +1234,7 @@ static VALUE
rb_f_autoload(VALUE obj, VALUE sym, VALUE file)
{
VALUE klass = rb_class_real(rb_vm_cbase());
if (NIL_P(klass)) {
if (!klass) {
rb_raise(rb_eTypeError, "Can not set autoload on singleton class");
}
return rb_mod_autoload(klass, sym, file);