* parse.y (rb_intern3): check symbol table overflow before generate

next id.  [ruby-core:26092]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-10-15 09:26:15 +00:00
parent 37531934e6
commit e5e49b3a27
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
Thu Oct 15 16:57:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Oct 15 18:26:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (rb_intern3): check symbol table overflow. * parse.y (rb_intern3): check symbol table overflow before generate
[ruby-core:26092] next id. [ruby-core:26092]
Thu Oct 15 15:14:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Oct 15 15:14:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>

View File

@ -9498,7 +9498,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
mbstr:; mbstr:;
} }
new_id: new_id:
if (!(global_symbols.last_id << (ID_SCOPE_SHIFT+RUBY_SPECIAL_SHIFT))) { if (global_symbols.last_id >= ~(ID)0 >> (ID_SCOPE_SHIFT+RUBY_SPECIAL_SHIFT)) {
if (len > 20) { if (len > 20) {
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.20s...)", rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.20s...)",
name); name);