ruby-changes:34322
From: nagachika <ko1@a...>
Date: Wed, 11 Jun 2014 02:43:56 +0900 (JST)
Subject: [ruby-changes:34322] nagachika:r46403 (ruby_2_1): merge revision(s) r45308, r45316: [Backport #9621]
nagachika 2014-06-11 02:43:49 +0900 (Wed, 11 Jun 2014) New Revision: 46403 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46403 Log: merge revision(s) r45308,r45316: [Backport #9621] * ext/objspace/objspace_dump.c: Check fptr before trying to dump RFILE object fd. [GH-562] * test/objspace/test_objspace.rb: add test * test/objspace/test_objspace.rb (TestObjSpace#test_dump_uninitialized_file): remove dependency on json library. Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/ext/objspace/objspace_dump.c branches/ruby_2_1/test/objspace/test_objspace.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46402) +++ ruby_2_1/ChangeLog (revision 46403) @@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Wed Jun 11 02:43:32 2014 Kazuki Tsujimoto <kazuki@c...> + + * test/objspace/test_objspace.rb (TestObjSpace#test_dump_uninitialized_file): + remove dependency on json library. + +Wed Jun 11 02:43:32 2014 Scott Francis <scott.francis@s...> + + * ext/objspace/objspace_dump.c: Check fptr before trying to dump RFILE + object fd. [GH-562] + + * test/objspace/test_objspace.rb: add test + Wed Jun 11 02:27:55 2014 Akinori MUSHA <knu@i...> * configure.in: Fix a build problem with clang and --with-opt-dir. Index: ruby_2_1/ext/objspace/objspace_dump.c =================================================================== --- ruby_2_1/ext/objspace/objspace_dump.c (revision 46402) +++ ruby_2_1/ext/objspace/objspace_dump.c (revision 46403) @@ -232,7 +232,8 @@ dump_object(VALUE obj, struct dump_confi https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/objspace/objspace_dump.c#L232 case T_FILE: fptr = RFILE(obj)->fptr; - dump_append(dc, ", \"fd\":%d", fptr->fd); + if (fptr) + dump_append(dc, ", \"fd\":%d", fptr->fd); break; case T_ZOMBIE: Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46402) +++ ruby_2_1/version.h (revision 46403) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-06-11" -#define RUBY_PATCHLEVEL 127 +#define RUBY_PATCHLEVEL 128 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 6 Index: ruby_2_1/test/objspace/test_objspace.rb =================================================================== --- ruby_2_1/test/objspace/test_objspace.rb (revision 46402) +++ ruby_2_1/test/objspace/test_objspace.rb (revision 46403) @@ -266,4 +266,14 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/objspace/test_objspace.rb#L266 File.unlink(output) end end + + def test_dump_uninitialized_file + assert_in_out_err(%[-robjspace], <<-RUBY) do |(output), (error)| + puts ObjectSpace.dump(File.allocate) + RUBY + assert_nil error + assert_match /"type":"FILE"/, output + assert_not_match /"fd":/, output + end + end end Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r45308,45316 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/