Actions
Bug #14670
closedObjectで定義したmethod_missingでsuperが使えない
Description
class Object
def method_missing(name, *args, &block)
super
end
end
Object.new.foo
を実行すると, SystemStackError
になってしまいます.
再定義する先がObject
でなければ(Object
のサブクラスなら)問題ないです.
Updated by nobu (Nobuyoshi Nakada) over 6 years ago
- Related to Feature #14313: Support creating KeyError with receiver and key from Ruby added
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
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
Like0
Like0Like0Like0