ruby-changes:63304
From: Nobuyoshi <ko1@a...>
Date: Fri, 9 Oct 2020 11:49:57 +0900 (JST)
Subject: [ruby-changes:63304] 6944b927bd (master): rb_class_real never returns Qnil
https://git.ruby-lang.org/ruby.git/commit/?id=6944b927bd From 6944b927bdaaa9c27407eaa5ce411b9bad75af5b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 9 Oct 2020 01:21:10 +0900 Subject: rb_class_real never returns Qnil diff --git a/load.c b/load.c index b0143b7..cb3a6c0 100644 --- a/load.c +++ b/load.c @@ -1234,7 +1234,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/load.c#L1234 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); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/