Actions
Bug #10731
closedSegmentation fault when create alias to refined method
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-12 trunk 49218) [x86_64-darwin14]
Backport:
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
Updated by hanachin (Seiei Miyagi) over 9 years ago
- File 0001-vm_method.c-raise-a-NameError-when-create-alias-to-r.patch 0001-vm_method.c-raise-a-NameError-when-create-alias-to-r.patch added
the patch for this.
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r49221.
vm_method.c: NameError at refined method alias
- vm_method.c (rb_alias): raise a NameError when creating alias to
a refined method if the original method of the refined method is
not defined. [ruby-core:67523] [Bug #10731]
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED
Updated by naruse (Yui NARUSE) over 9 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE
ruby_2_2 r49311 merged revision(s) 49221.
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE
ruby_2_0_0 r49425 merged revision(s) 49221.
test is a little changed to get rid of a warning about refinement on 2.0.0.
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Backport changed from 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: DONE, 2.2: DONE
Backported into ruby_2_1
branch at r49787.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0