Project

General

Profile

Actions

Bug #10731

closed

Segmentation fault when create alias to refined method

Added by hanachin (Seiei Miyagi) over 9 years ago. Updated about 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-12 trunk 49218) [x86_64-darwin14]
[ruby-core:67523]

Description

following code cause segmentation fault, both foo and bar is not defined in refined class, in trunk and 2.2.0, 2.1.5, 2.0.0

class C
end

module RefinementBug
  refine C do
    def foo
    end

    def bar
    end
  end
end

class C
  alias foo bar
end

it should be raise a NameError if the original method of the refined method is not exist, like undef (#8966).


Files

ruby_2015-01-12-135103_Nil.crash (11.3 KB) ruby_2015-01-12-135103_Nil.crash hanachin (Seiei Miyagi), 01/12/2015 04:57 AM
bug.rb (128 Bytes) bug.rb hanachin (Seiei Miyagi), 01/12/2015 04:58 AM
0001-vm_method.c-raise-a-NameError-when-create-alias-to-r.patch (1.77 KB) 0001-vm_method.c-raise-a-NameError-when-create-alias-to-r.patch hanachin (Seiei Miyagi), 01/12/2015 05:08 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0