summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 16:05:31 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 16:05:31 +0000
commit8b5f0528a7b0b4740708e2e5b74e1e0c79eab45f (patch)
treece34d3ff98004140a67f2f113dccf492167e5ec7
parent6ab0f648baf9c9f5373837314b4eb3dde7803647 (diff)
merge revision(s) 39595: [Backport #8014]
* ext/objspace/objspace.c (count_nodes): count also newly added nodes, and fix key for unknown node. patch by tmm1 (Aman Gupta) in [ruby-core:53130] [Bug #8014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/objspace/objspace.c5
-rw-r--r--test/objspace/test_objspace.rb4
-rw-r--r--version.h2
4 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e1106733fe..51be6bcf9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Mar 25 01:05:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/objspace/objspace.c (count_nodes): count also newly added nodes,
+ and fix key for unknown node. patch by tmm1 (Aman Gupta) in
+ [ruby-core:53130] [Bug #8014]
+
Mon Mar 25 01:00:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_prepend_module): check redefinition of built-in optimized
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index b8f524cb6f..5857327f21 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -469,6 +469,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_OP_ASGN2);
COUNT_NODE(NODE_OP_ASGN_AND);
COUNT_NODE(NODE_OP_ASGN_OR);
+ COUNT_NODE(NODE_OP_CDECL);
COUNT_NODE(NODE_CALL);
COUNT_NODE(NODE_FCALL);
COUNT_NODE(NODE_VCALL);
@@ -502,6 +503,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_ARGS);
COUNT_NODE(NODE_ARGS_AUX);
COUNT_NODE(NODE_OPT_ARG);
+ COUNT_NODE(NODE_KW_ARG);
COUNT_NODE(NODE_POSTARG);
COUNT_NODE(NODE_ARGSCAT);
COUNT_NODE(NODE_ARGSPUSH);
@@ -519,6 +521,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_SCLASS);
COUNT_NODE(NODE_COLON2);
COUNT_NODE(NODE_COLON3);
+ COUNT_NODE(NODE_CREF);
COUNT_NODE(NODE_DOT2);
COUNT_NODE(NODE_DOT3);
COUNT_NODE(NODE_FLIP2);
@@ -539,7 +542,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_PRELUDE);
COUNT_NODE(NODE_LAMBDA);
#undef COUNT_NODE
- default: node = INT2FIX(nodes[i]);
+ default: node = INT2FIX(i);
}
rb_hash_aset(hash, node, SIZET2NUM(nodes[i]));
}
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 136f7e8318..2f8503fcee 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -58,7 +58,9 @@ class TestObjSpace < Test::Unit::TestCase
assert_equal(false, res.empty?)
arg = {}
ObjectSpace.count_nodes(arg)
- assert_equal(false, arg.empty?)
+ assert_not_empty(arg)
+ bug8014 = '[ruby-core:53130] [Bug #8014]'
+ assert_empty(arg.select {|k, v| !(Symbol === k && Integer === v)}, bug8014)
end
def test_count_tdata_objects
diff --git a/version.h b/version.h
index ce91fe942c..8642795732 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-03-25"
-#define RUBY_PATCHLEVEL 90
+#define RUBY_PATCHLEVEL 91
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 3