ruby-changes:14021
From: shugo <ko1@a...>
Date: Wed, 18 Nov 2009 10:14:10 +0900 (JST)
Subject: [ruby-changes:14021] Ruby:r25831 (trunk): * vm_method.c (rb_undef): should raise TypeError if klass is nil.
shugo 2009-11-18 10:13:54 +0900 (Wed, 18 Nov 2009) New Revision: 25831 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25831 Log: * vm_method.c (rb_undef): should raise TypeError if klass is nil. 1.instance_eval { undef to_s } causes SEGV before this fix. * test/ruby/test_undef.rb: new tests for undef. Modified files: trunk/ChangeLog trunk/vm_method.c Index: ChangeLog =================================================================== --- ChangeLog (revision 25830) +++ ChangeLog (revision 25831) @@ -1,3 +1,10 @@ +Wed Nov 18 10:12:34 2009 Shugo Maeda <shugo@r...> + + * vm_method.c (rb_undef): should raise TypeError if klass is nil. + 1.instance_eval { undef to_s } causes SEGV before this fix. + + * test/ruby/test_undef.rb: new tests for undef. + Wed Nov 18 08:41:42 2009 Nobuyoshi Nakada <nobu@r...> * string.c (str_utf8_nth): fixed overrun. [ruby-core:26787] Index: vm_method.c =================================================================== --- vm_method.c (revision 25830) +++ vm_method.c (revision 25831) @@ -574,6 +574,9 @@ { rb_method_entry_t *me; + if (NIL_P(klass)) { + rb_raise(rb_eTypeError, "no class to undef method"); + } if (rb_vm_cbase() == rb_cObject && klass == rb_cObject) { rb_secure(4); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/