summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-05 01:40:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-05 01:40:52 +0000
commitb4a117f8d3be2aff93521c388587eff8c8601199 (patch)
tree997a725935411e8e17584095c0b4beea223b399b /ext/objspace
parent4a429c11e1319b0e13368851454f109217ab5de5 (diff)
objspace.c: newly added nodes
* 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/trunk@39595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/objspace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index b8f524c..5857327 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]));
}