1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2014-06-10 17:43:49 +00:00
parent 089d93ca1d
commit ad5214df98
4 changed files with 25 additions and 2 deletions

View file

@ -1,3 +1,15 @@
Wed Jun 11 02:43:32 2014 Kazuki Tsujimoto <kazuki@callcc.net>
* 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@shopify.com>
* 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@iDaemons.org>
* configure.in: Fix a build problem with clang and --with-opt-dir.

View file

@ -232,6 +232,7 @@ dump_object(VALUE obj, struct dump_config *dc)
case T_FILE:
fptr = RFILE(obj)->fptr;
if (fptr)
dump_append(dc, ", \"fd\":%d", fptr->fd);
break;

View file

@ -266,4 +266,14 @@ class TestObjSpace < Test::Unit::TestCase
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

View file

@ -1,6 +1,6 @@
#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