Permalink
Browse files

rb_alias() raises an TypeError when passed Qnil

  • Loading branch information...
1 parent e34016e commit 76f826daa39ebf93aa5fb34ee8406c35786c27f3 @Watson1978 Watson1978 committed Jan 5, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 vm.cpp
View
4 vm.cpp
@@ -1554,6 +1554,10 @@ vm_alias_method(Class klass, Method method, ID name, bool noargs)
static void
vm_alias(VALUE outer, ID name, ID def)
{
+ if (NIL_P(outer)) {
+ rb_raise(rb_eTypeError, "no class to make alias");
+ }
+
rb_frozen_class_p(outer);
if (outer == rb_cObject) {
rb_secure(4);

0 comments on commit 76f826d

Please sign in to comment.