diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-15 07:57:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-15 07:57:40 +0000 |
commit | 37531934e6e39c4863db87134c04efa3d3d63f61 (patch) | |
tree | e8e81ac2e16f4d88b9bfd384f035dcde7c5026e2 /string.c | |
parent | 9fff5f0fabb50ab0d46034d6c1b9dcc4447a8a66 (diff) |
* parse.y (rb_intern3): check symbol table overflow.
[ruby-core:26092]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 19 |
1 files changed, 2 insertions, 17 deletions
@@ -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); } |