mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* parse.y (rb_intern): should check symbol table overflow.
#3900 [ruby-dev:42330] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b5dde87123
commit
a1ab2bc8a4
3 changed files with 18 additions and 3 deletions
10
parse.y
10
parse.y
|
@ -6227,6 +6227,16 @@ rb_intern(name)
|
|||
}
|
||||
if (*m) id = ID_JUNK;
|
||||
new_id:
|
||||
if (last_id >= SYM2ID(~(VALUE)0) >> ID_SCOPE_SHIFT) {
|
||||
if (last > 20) {
|
||||
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.20s...)",
|
||||
name);
|
||||
}
|
||||
else {
|
||||
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.*s)",
|
||||
last, name);
|
||||
}
|
||||
}
|
||||
id |= ++last_id << ID_SCOPE_SHIFT;
|
||||
id_regist:
|
||||
name = strdup(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue