Project

General

Profile

Bug #14670

Objectで定義したmethod_missingでsuperが使えない

Added by keiju (Keiju Ishitsuka) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-dev:50522]

Description

class Object
  def method_missing(name, *args, &block)
    super
  end
end

Object.new.foo

を実行すると, SystemStackError になってしまいます.

再定義する先がObjectでなければ(Objectのサブクラスなら)問題ないです.


Related issues

Related to Ruby master - Feature #14313: Support creating KeyError with receiver and key from RubyClosedActions

Associated revisions

Revision a72581d7
Added by nobu (Nobuyoshi Nakada) over 1 year ago

error.c: super in method_missing

  • error.c (nometh_err_initialize): do not shirtcut rb_call_super,
    to push proper control frame. [ruby-dev:50522] [Bug #14670]

  • error.c (rb_nomethod_err_new): allocate and initialize a new
    NoMethodError instance.

  • vm_eval.c (rb_make_no_method_exception): create a new exception
    instance directly without method calls, to prevent influence of
    ruby level method definitions, which can cause an unpredictable
    behavior, e.g., infinite recursion.

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

Revision 63136
Added by nobu (Nobuyoshi Nakada) over 1 year ago

error.c: super in method_missing

  • error.c (nometh_err_initialize): do not shirtcut rb_call_super,
    to push proper control frame. [ruby-dev:50522] [Bug #14670]

  • error.c (rb_nomethod_err_new): allocate and initialize a new
    NoMethodError instance.

  • vm_eval.c (rb_make_no_method_exception): create a new exception
    instance directly without method calls, to prevent influence of
    ruby level method definitions, which can cause an unpredictable
    behavior, e.g., infinite recursion.

Revision 63136
Added by nobu (Nobuyoshi Nakada) over 1 year ago

error.c: super in method_missing

  • error.c (nometh_err_initialize): do not shirtcut rb_call_super,
    to push proper control frame. [ruby-dev:50522] [Bug #14670]

  • error.c (rb_nomethod_err_new): allocate and initialize a new
    NoMethodError instance.

  • vm_eval.c (rb_make_no_method_exception): create a new exception
    instance directly without method calls, to prevent influence of
    ruby level method definitions, which can cause an unpredictable
    behavior, e.g., infinite recursion.

Revision 76e3af82
Added by nobu (Nobuyoshi Nakada) 11 months ago

Warn redefinitions of some methods on Object

[Bug #5473] [Bug #14670] [Bug #15382]

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

Revision 66262
Added by nobu (Nobuyoshi Nakada) 11 months ago

Warn redefinitions of some methods on Object

[Bug #5473] [Bug #14670] [Bug #15382]

Revision 66262
Added by nobu (Nobuyoshi Nakada) 11 months ago

Warn redefinitions of some methods on Object

[Bug #5473] [Bug #14670] [Bug #15382]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Related to Feature #14313: Support creating KeyError with receiver and key from Ruby added
#2

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONTNEED
  • Description updated (diff)
#3

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r63136.


error.c: super in method_missing

  • error.c (nometh_err_initialize): do not shirtcut rb_call_super,
    to push proper control frame. [ruby-dev:50522] [Bug #14670]

  • error.c (rb_nomethod_err_new): allocate and initialize a new
    NoMethodError instance.

  • vm_eval.c (rb_make_no_method_exception): create a new exception
    instance directly without method calls, to prevent influence of
    ruby level method definitions, which can cause an unpredictable
    behavior, e.g., infinite recursion.

Also available in: Atom PDF