diff --git a/ChangeLog b/ChangeLog index 891e708a88..ddbd7e8697 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Jun 21 23:08:19 2007 Yukihiro Matsumoto + + * parse.y (rb_intern2): ID_JUNK test based on len, not by NUL. + Thu Jun 21 19:42:07 2007 Nobuyoshi Nakada * yarvcore.c (rb_thread_mark): mark also thrown_errinfo. diff --git a/parse.y b/parse.y index 70c57ac796..c2ca84ce3f 100644 --- a/parse.y +++ b/parse.y @@ -8420,8 +8420,8 @@ rb_symname_p(const char *name) ID rb_intern2(const char *name, long len) { + const char *m = name; VALUE str = rb_str_new(name, len); - const char *m = RSTRING_PTR(str); ID id; int last; @@ -8481,7 +8481,7 @@ rb_intern2(const char *name, long len) m += mbclen(*m); } } - if (*m) id = ID_JUNK; + if (m - name < len) id = ID_JUNK; new_id: id |= ++global_symbols.last_id << ID_SCOPE_SHIFT; id_register: