summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-15 07:57:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-15 07:57:40 +0000
commit5d30d35036f6bfd3588e0e71f59b42baff3e61ed (patch)
treee8e81ac2e16f4d88b9bfd384f035dcde7c5026e2 /string.c
parent498d8031e23234a3cf8aebd185128ac7bcc35522 (diff)
downloadruby-5d30d35036f6bfd3588e0e71f59b42baff3e61ed.tar.gz
ruby-5d30d35036f6bfd3588e0e71f59b42baff3e61ed.tar.xz
ruby-5d30d35036f6bfd3588e0e71f59b42baff3e61ed.zip
* parse.y (rb_intern3): check symbol table overflow.
[ruby-core:26092] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25351 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 a8f2a1eee..ca093517a 100644
--- a/string.c
+++ b/string.c
@@ -6510,25 +6510,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);
}