Forum: Ruby-core [ruby-trunk - Bug #8014][Open] Add missing node types to ObjectSpace.count_nodes

Posted by tmm1 (Aman Gupta) (Guest)
on 2013-03-05 02:10
(Received via mailing list)
Issue #8014 has been reported by tmm1 (Aman Gupta).

----------------------------------------
Bug #8014: Add missing node types to ObjectSpace.count_nodes
https://bugs.ruby-lang.org/issues/8014

Author: tmm1 (Aman Gupta)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474)


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]));
   }
Posted by usa (Usaku NAKAMURA) (Guest)
on 2013-03-28 10:36
(Received via mailing list)
Issue #8014 has been updated by usa (Usaku NAKAMURA).

Status changed from Assigned to Closed

1.9.3 doesn't have NODE_OP_CDECL. so, this issue is closed.
----------------------------------------
Backport #8014: Add missing node types to ObjectSpace.count_nodes
https://bugs.ruby-lang.org/issues/8014#change-37991

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]));
   }
Posted by tmm1 (Aman Gupta) (Guest)
on 2013-03-28 22:42
(Received via mailing list)
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]));
   }
Posted by usa (Usaku NAKAMURA) (Guest)
on 2013-04-04 05:44
(Received via mailing list)
Issue #8014 has been updated by usa (Usaku NAKAMURA).

Status changed from Closed to Assigned


----------------------------------------
Backport #8014: Add missing node types to ObjectSpace.count_nodes
https://bugs.ruby-lang.org/issues/8014#change-38201

Author: tmm1 (Aman Gupta)
Status: Assigned
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]));
   }
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.