diff options
author | tmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-17 10:55:29 +0000 |
---|---|---|
committer | tmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-17 10:55:29 +0000 |
commit | cef6a377fcae99d062b2c7d9e0db2c07719c6975 (patch) | |
tree | fd94d29a17c9856dd9b706b2bd2461986f9b98c2 | |
parent | 626235a6d7f0808dd83baae73913efea4f71fa57 (diff) | |
download | ruby-cef6a377fcae99d062b2c7d9e0db2c07719c6975.tar.gz |
iseq.c: remove duplicated strings for file paths
* iseq.c (iseq_location_setup): re-use existing string when iseq has
the same path and absolute_path. [Bug #8149]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | iseq.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed Apr 17 19:45:27 2013 Aman Gupta <tmm1@ruby-lang.org> + + * iseq.c (iseq_location_setup): re-use existing string when iseq has + the same path and absolute_path. [Bug #8149] + Wed Apr 17 11:38:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): @@ -188,7 +188,10 @@ iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name { rb_iseq_location_t *loc = &iseq->location; loc->path = path; - loc->absolute_path = absolute_path; + if (RTEST(absolute_path) && rb_str_cmp(path, absolute_path) == 0) + loc->absolute_path = path; + else + loc->absolute_path = absolute_path; loc->label = loc->base_label = name; loc->first_lineno = first_lineno; return loc; |