Project

General

Profile

Backport #8014

Add missing node types to ObjectSpace.count_nodes

Added by tmm1 (Aman Gupta) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:53130]

Description

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])); }

Associated revisions

Revision b4a117f8
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 39595
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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]

Revision 39595
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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]

Revision 39595
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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]

Revision 39595
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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]

Revision 39595
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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]

Revision 39595
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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]

Revision 8b5f0528
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

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

Revision 9188504a
Added by usa (Usaku NAKAMURA) over 6 years ago

  • ext/objspace/objspace.c (count_nodes): fix key for unknown node. based on a patch by tmm1 (Aman Gupta) in [ruby-core:53130] [Bug #8014]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40099
Added by usa (Usaku NAKAMURA) over 6 years ago

  • ext/objspace/objspace.c (count_nodes): fix key for unknown node. based on a patch by tmm1 (Aman Gupta) in [ruby-core:53130] [Bug #8014]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39595.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


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]
#2

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Status changed from Closed to Assigned
  • Assignee set to nagachika (Tomoyuki Chikanaga)

I believe this is definitely a bug fix. I will merge r39595.

#3

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39913.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


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]
#4

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Project changed from Backport200 to Backport193
  • Status changed from Closed to Assigned
  • Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)

I think r39595 need to backport partially (for NODE_OP_CDECL) to ruby_1_9_3.

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed

1.9.3 doesn't have NODE_OP_CDECL. so, this issue is closed.

Updated by tmm1 (Aman Gupta) over 6 years ago

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])); }

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Closed to Assigned
#8

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40099.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/objspace/objspace.c (count_nodes): fix key for unknown node. based on a patch by tmm1 (Aman Gupta) in [ruby-core:53130] [Bug #8014]

Also available in: Atom PDF