* parse.y (next_id): use rb_str_ellipsize to preserve encoding and
  get rid of incomplete multibyte sequence.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-04-30 12:09:35 +00:00
Родитель ca319081ce
Коммит 60375cd6ba
1 изменённых файлов: 3 добавлений и 8 удалений

11
parse.y
Просмотреть файл

@ -10642,14 +10642,9 @@ next_id(VALUE str)
new_id: new_id:
if (symenc != enc) rb_enc_associate(str, symenc); if (symenc != enc) rb_enc_associate(str, symenc);
if ((nid = next_id_base()) == (ID)-1) { if ((nid = next_id_base()) == (ID)-1) {
if (len > 20) { str = rb_str_ellipsize(str, 20);
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.20s...)", rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %"PRIsVALUE")",
name); str);
}
else {
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.*s)",
(int)len, name);
}
} }
id |= nid; id |= nid;
id |= ID_STATIC_SYM; id |= ID_STATIC_SYM;