Project

General

Profile

This project is closed and read-only.

Actions

Backport #8014

closed

Add missing node types to ObjectSpace.count_nodes

Backport #8014: Add missing node types to ObjectSpace.count_nodes

Added by tmm1 (Aman Karmani) over 13 years ago. Updated over 13 years ago.

Status:
Closed
[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]));
    
    }

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #1

  • 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]

Updated by nagachika (Tomoyuki Chikanaga) over 13 years ago Actions #2

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

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

Updated by nagachika (Tomoyuki Chikanaga) over 13 years ago Actions #3

  • 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]

Updated by nagachika (Tomoyuki Chikanaga) over 13 years ago Actions #4

  • Project changed from 15 to 13
  • 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 13 years ago Actions #5 [ruby-core:53794]

  • Status changed from Assigned to Closed

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

Updated by tmm1 (Aman Karmani) over 13 years ago Actions #6 [ruby-core:53812]

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 13 years ago Actions #7 [ruby-core:53980]

  • Status changed from Closed to Assigned

Updated by usa (Usaku NAKAMURA) over 13 years ago Actions #8

  • 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]
Actions

Also available in: PDF Atom