summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-30 12:09:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-30 12:09:35 +0000
commit60375cd6ba034de80012726f50c7c43c3a8a3b68 (patch)
tree77c74fb3311aa94533c6d04d8cff3faa92f11cf7 /parse.y
parentca319081ce97f0c6db7695f919d9bbd74ed8921d (diff)
parse.y: use rb_str_ellipsize
* 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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y11
1 files changed, 3 insertions, 8 deletions
diff --git a/parse.y b/parse.y
index b0f84e1540..a6a3905a9f 100644
--- a/parse.y
+++ b/parse.y
@@ -10642,14 +10642,9 @@ next_id(VALUE str)
new_id:
if (symenc != enc) rb_enc_associate(str, symenc);
if ((nid = next_id_base()) == (ID)-1) {
- if (len > 20) {
- rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.20s...)",
- name);
- }
- else {
- rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.*s)",
- (int)len, name);
- }
+ str = rb_str_ellipsize(str, 20);
+ rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %"PRIsVALUE")",
+ str);
}
id |= nid;
id |= ID_STATIC_SYM;