From 180c744b3b4043b2491031a4af9c8cbe4c0ae2ab Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 27 Oct 2012 02:10:53 +0000 Subject: * numeric.c (rb_float_new_in_heap), include/ruby/ruby.h: make all Float objects frozen. [ruby-dev:46081] [ruby-trunk - Feature #6936] Most part of patch by NARUSE, Yui . * class.c (singleton_class_of): raise TypeError when trying to define a singleton method on Float objects. * vm.c (vm_define_method): ditto. * test/ruby/marshaltestlib.rb: catch up above changes. * test/ruby/test_class.rb: ditto. * test/test_pp.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ruby/ruby.h') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 7fe38a0f1d..34f2c69152 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1133,7 +1133,7 @@ struct RBignum { (FL_TAINT | FL_UNTRUSTED); \ } while (0) -#define OBJ_FROZEN(x) (!!FL_TEST((x), FL_FREEZE)) +#define OBJ_FROZEN(x) (!!(FL_ABLE(x)?(RBASIC(x)->flags&(FL_FREEZE)):FLONUM_P(x))) #define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE) #if SIZEOF_INT < SIZEOF_LONG -- cgit v1.2.3