summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-24 10:43:56 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-24 10:43:56 +0000
commit8ae09f0589c305b876fde4214fe74369c55ef818 (patch)
treee2ceccd2798e06bf2a6d29f7f2d23b197b88183c
parent54002265d1292ae8df9615a51bf3ac4cdfb9820f (diff)
downloadruby-8ae09f0589c305b876fde4214fe74369c55ef818.tar.gz
ruby-8ae09f0589c305b876fde4214fe74369c55ef818.tar.xz
ruby-8ae09f0589c305b876fde4214fe74369c55ef818.zip
* parse.y (debug_lines): Always prepare a new array for each
file's SCRIPT_LINES__ storage, instead of appending source lines every time a file is re-loaded; submitted by Rocky Bernstein in #18517. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--parse.y7
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c2dea145e..5f48b3492 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Mar 24 19:23:52 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * parse.y (debug_lines): Always prepare a new array for each
+ file's SCRIPT_LINES__ storage, instead of appending source lines
+ every time a file is re-loaded; submitted by Rocky Bernstein in
+ #18517.
+
Mon Mar 24 10:25:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: sitearch should use target_cpu. [ruby-core:15986]
diff --git a/parse.y b/parse.y
index 33aba9b6f..8181c5c40 100644
--- a/parse.y
+++ b/parse.y
@@ -4680,11 +4680,8 @@ debug_lines(const char *f)
VALUE hash = rb_const_get_at(rb_cObject, rb_intern("SCRIPT_LINES__"));
if (TYPE(hash) == T_HASH) {
VALUE fname = rb_str_new2(f);
- VALUE lines = rb_hash_lookup(hash, fname);
- if (NIL_P(lines)) {
- lines = rb_ary_new();
- rb_hash_aset(hash, fname, lines);
- }
+ VALUE lines = rb_ary_new();
+ rb_hash_aset(hash, fname, lines);
return lines;
}
}