summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 09:39:48 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 09:39:48 +0000
commit69b51262f3ec90a2ac9553d7cd34ee285ec59ad5 (patch)
treed5dbd1722ac67757360b090c5c2890d99b0fb865 /string.c
parent190554f06592cfce9ff262f594eaff28d5aa987a (diff)
merges r25351 from trunk into ruby_1_9_1. fixes the backport task #2214.
-- * parse.y (rb_intern3): check symbol table overflow. [ruby-core:26092] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/string.c b/string.c
index 5cf5d9bc97..725ba34ee0 100644
--- a/string.c
+++ b/string.c
@@ -6379,25 +6379,10 @@ VALUE
rb_str_intern(VALUE s)
{
VALUE str = RB_GC_GUARD(s);
- VALUE sym;
- ID id, id2;
+ ID id;
id = rb_intern_str(str);
- sym = ID2SYM(id);
- id2 = SYM2ID(sym);
- if (id != id2) {
- const char *name = rb_id2name(id2);
-
- if (name) {
- rb_raise(rb_eRuntimeError, "symbol table overflow (%s given for %s)",
- name, RSTRING_PTR(str));
- }
- else {
- rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %s)",
- RSTRING_PTR(str));
- }
- }
- return sym;
+ return ID2SYM(id);
}