summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--parse.y10
-rw-r--r--version.h2
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 53592da0b7..e1ba173249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Oct 3 18:30:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_intern): should check symbol table overflow.
+ #3900 [ruby-dev:42330]
+
Fri Oct 1 15:12:05 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (init_stdhandle): redirect unopened IOs to NUL.
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);
diff --git a/version.h b/version.h
index 550fdd8001..d290abc596 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2010-11-22"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20101122
-#define RUBY_PATCHLEVEL 312
+#define RUBY_PATCHLEVEL 313
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8