Project

General

Profile

Feature #5089

Even More Inadvertent Symbol Removal, And Fix Issue With Previous Code

Added by jeremyevans0 (Jeremy Evans) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:38447]

Description

This is the third and hopefully final patch for removing inadvertent symbol creation. It removes it from the following methods:

alias_method
autoload?
private_class_method
private_constant
private
protected
public
public_class_method
public_constant
remove_method
undef_method
untrace_var

It also removes it from const_get if an invalid constant name is used or const_missing has not been overridden. If a valid constant name is used and const_missing has been overridden, then a symbol must be created so it can be passed to const_missing.

The second patch fixes the previous patches to handle the case where a non-String that implements to_str is passed to the methods.


Files


Related issues

Precedes Ruby master - Feature #5072: Avoid inadvertent symbol creation in reflection methodsClosed07/25/201107/25/2011Actions

Associated revisions

Revision 8603c593
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

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

Revision 32686
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

Revision 32686
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

Revision 32686
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

Revision 32686
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

Revision 32686
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

Revision 32686
Added by nobu (Nobuyoshi Nakada) about 8 years ago

  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

History

#1

Updated by nobu (Nobuyoshi Nakada) about 8 years ago

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

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


  • eval_error.c (rb_print_undef_str): new function to raise NameError for undefined method.
  • load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089]

Also available in: Atom PDF