diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-21 14:16:00 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-21 14:16:00 +0000 |
| commit | 1697473f4919003f31e684df747c16d7e0d4b100 (patch) | |
| tree | d093f11df7682c60dcd8108340f2f02c3a634dcc /parse.y | |
| parent | 6bcfb2508a55364322217575a873dd2126f6f684 (diff) | |
| download | ruby-1697473f4919003f31e684df747c16d7e0d4b100.tar.gz ruby-1697473f4919003f31e684df747c16d7e0d4b100.tar.xz ruby-1697473f4919003f31e684df747c16d7e0d4b100.zip | |
* parse.y (rb_intern2): ID_JUNK test based on len, not by NUL.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
| -rw-r--r-- | parse.y | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |
