diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-17 15:56:36 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-17 15:56:36 +0000 |
| commit | 3cac210d69a81eb3b42b5c267946432a4b0dc7b1 (patch) | |
| tree | 5661f4f449b952ec26851deddc9e9f5def8f2447 /variable.c | |
| parent | af128f53cd65d6a6a1090170941600c451c74dfe (diff) | |
| download | ruby-3cac210d69a81eb3b42b5c267946432a4b0dc7b1.tar.gz ruby-3cac210d69a81eb3b42b5c267946432a4b0dc7b1.tar.xz ruby-3cac210d69a81eb3b42b5c267946432a4b0dc7b1.zip | |
* variable.c (rb_path2class): get rid of dangling pointer caused by
optimized out value.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
| -rw-r--r-- | variable.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/variable.c b/variable.c index caba12411..388907078 100644 --- a/variable.c +++ b/variable.c @@ -235,11 +235,8 @@ rb_path2class(const char *path) } pbeg = p = path; while (*p) { - VALUE str; - while (*p && *p != ':') p++; - str = rb_str_new(pbeg, p-pbeg); - id = rb_intern(RSTRING_PTR(str)); + id = rb_intern2(pbeg, p-pbeg); if (p[0] == ':') { if (p[1] != ':') goto undefined_class; p += 2; |
