1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (rb_intern2): ID_JUNK test based on len, not by NUL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-06-21 14:16:00 +00:00
parent 5a164c1891
commit 967cca2f8d
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Thu Jun 21 23:08:19 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (rb_intern2): ID_JUNK test based on len, not by NUL.
Thu Jun 21 19:42:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* yarvcore.c (rb_thread_mark): mark also thrown_errinfo.

View file

@ -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: