Project

General

Profile

Actions

Bug #14670

closed

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

Added by keiju (Keiju Ishitsuka) over 6 years ago. Updated over 6 years ago.

Status:
Closed
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 1 (0 open1 closed)

Related to Ruby master - Feature #14313: Support creating KeyError with receiver and key from RubyClosedmatz (Yukihiro Matsumoto)Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

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

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

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

Updated by nobu (Nobuyoshi Nakada) over 6 years 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0