From: "tmm1 (Aman Gupta)" Date: 2013-03-29T06:41:48+09:00 Subject: [ruby-core:53812] [Backport93 - Backport #8014] Add missing node types to ObjectSpace.count_nodes Issue #8014 has been updated by tmm1 (Aman Gupta). 1.9.3 still contains this bug: @@ -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])); } ---------------------------------------- Backport #8014: Add missing node types to ObjectSpace.count_nodes https://bugs.ruby-lang.org/issues/8014#change-38014 Author: tmm1 (Aman Gupta) Status: Closed Priority: Normal Assignee: usa (Usaku NAKAMURA) Category: Target version: 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])); } -- http://bugs.ruby-lang.org/