Project

General

Profile

Feature #5112

Remove inadvertent symbol creation from send, __send__, and public_send

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

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

Description

When I was first working on the inadvertent symbol creation removal code, I didn't think it was possible to handle send because method_missing requires a symbol as the first argument. But once I figured out how to handle the similar situation in respond_to? for respond_to_missing? (and used the same technique with const_get for const_missing), the same idea works for the send methods. Basically, if method_missing has been overridden, you must create the symbol, but if not, you can just raise a NoMethodError without creating the symbol.

I didn't add a test for it since I saw the tests for const_get and respond_to? were commented out in r32710 and r32711.


Files


Related issues

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

Associated revisions

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

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

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

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

  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

History

Updated by jeremyevans0 (Jeremy Evans) about 8 years ago

It's been over two months and I haven't had any feedback on this. Is there a reason this patch didn't get applied when the other similar patches did (in r32621, r32645, and r32686)?

#2

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 r33419.
Jeremy, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • vm_eval.c (make_no_method_execption): extract from raise_method_missing().
  • vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112]
  • vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and send, too.

Also available in: Atom PDF