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:
parent
5a164c1891
commit
967cca2f8d
2 changed files with 6 additions and 2 deletions
|
@ -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>
|
Thu Jun 21 19:42:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* yarvcore.c (rb_thread_mark): mark also thrown_errinfo.
|
* yarvcore.c (rb_thread_mark): mark also thrown_errinfo.
|
||||||
|
|
4
parse.y
4
parse.y
|
@ -8420,8 +8420,8 @@ rb_symname_p(const char *name)
|
||||||
ID
|
ID
|
||||||
rb_intern2(const char *name, long len)
|
rb_intern2(const char *name, long len)
|
||||||
{
|
{
|
||||||
|
const char *m = name;
|
||||||
VALUE str = rb_str_new(name, len);
|
VALUE str = rb_str_new(name, len);
|
||||||
const char *m = RSTRING_PTR(str);
|
|
||||||
ID id;
|
ID id;
|
||||||
int last;
|
int last;
|
||||||
|
|
||||||
|
@ -8481,7 +8481,7 @@ rb_intern2(const char *name, long len)
|
||||||
m += mbclen(*m);
|
m += mbclen(*m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*m) id = ID_JUNK;
|
if (m - name < len) id = ID_JUNK;
|
||||||
new_id:
|
new_id:
|
||||||
id |= ++global_symbols.last_id << ID_SCOPE_SHIFT;
|
id |= ++global_symbols.last_id << ID_SCOPE_SHIFT;
|
||||||
id_register:
|
id_register:
|
||||||
|
|
Loading…
Reference in a new issue