summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-28 16:11:27 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-28 16:11:27 +0000
commit3c0e4e61d68e20c239d1a8a25ca6e931ca1d802e (patch)
tree5cb9b3663f1f8bffc52296d2b777ea1501b75a3a
parent3750847f550d5d483e85cbe4e300dfd219a2095e (diff)
merges r24684 from trunk into ruby_1_9_1.
-- * vm_method.c (rb_remove_method_id): exported. * numeric.c (num_sadded): fix for non-ascii method name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@25547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--include/ruby/intern.h1
-rw-r--r--numeric.c6
-rw-r--r--test/ruby/test_numeric.rb1
-rw-r--r--version.h2
-rw-r--r--vm_method.c6
6 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ea1ed8a94..23ea369573 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Aug 27 18:31:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_remove_method_id): exported.
+
+ * numeric.c (num_sadded): fix for non-ascii method name.
+
Thu Aug 27 08:16:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/strscan/strscan.c (strscan_set_string): set string should not be
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 6444230382..1bcadb195f 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -259,6 +259,7 @@ NORETURN(void rb_exc_fatal(VALUE));
VALUE rb_f_exit(int,VALUE*);
VALUE rb_f_abort(int,VALUE*);
void rb_remove_method(VALUE, const char*);
+void rb_remove_method_id(VALUE, ID);
#define rb_disable_super(klass, name) ((void)0)
#define rb_enable_super(klass, name) ((void)0)
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
diff --git a/numeric.c b/numeric.c
index 95d16bd548..a69c2101f6 100644
--- a/numeric.c
+++ b/numeric.c
@@ -202,13 +202,13 @@ rb_num_coerce_relop(VALUE x, VALUE y, ID func)
static VALUE
num_sadded(VALUE x, VALUE name)
{
- const char *nstr = rb_id2name(rb_to_id(name));
+ ID mid = rb_to_id(name);
/* ruby_frame = ruby_frame->prev; */ /* pop frame for "singleton_method_added" */
/* Numerics should be values; singleton_methods should not be added to them */
- rb_remove_method(rb_singleton_class(x), nstr);
+ rb_remove_method_id(rb_singleton_class(x), mid);
rb_raise(rb_eTypeError,
"can't define singleton method \"%s\" for %s",
- nstr,
+ rb_id2name(mid),
rb_obj_classname(x));
return Qnil; /* not reached */
}
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
index 0dd7b2e99c..ae389004c1 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -47,6 +47,7 @@ class TestNumeric < Test::Unit::TestCase
def test_numeric
a = Numeric.new
assert_raise(TypeError) { def a.foo; end }
+ assert_raise(TypeError) { eval("def a.\u3042; end") }
assert_raise(TypeError) { a.dup }
end
diff --git a/version.h b/version.h
index 1505403b11..9436d98190 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 305
+#define RUBY_PATCHLEVEL 306
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1
diff --git a/vm_method.c b/vm_method.c
index 19a8a3ebbb..815de8773d 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -301,8 +301,8 @@ rb_method_node(VALUE klass, ID id)
return rb_get_method_body(klass, id, 0);
}
-static void
-remove_method(VALUE klass, ID mid)
+void
+rb_remove_method_id(VALUE klass, ID mid)
{
st_data_t data;
NODE *body = 0;
@@ -344,6 +344,8 @@ remove_method(VALUE klass, ID mid)
}
}
+#define remove_method(klass, mid) rb_remove_method_id(klass, mid)
+
void
rb_remove_method(VALUE klass, const char *name)
{