summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 9f14466816..df19699c0d 100644
--- a/parse.y
+++ b/parse.y
@@ -6222,6 +6222,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);