[ruby-dev:48882] [Ruby trunk - Bug #10885] Segmentation fault when calling refined method in duplicate module
From:
naruse@...
Date:
2015-02-24 01:52:38 UTC
List:
ruby-dev #48882
Issue #10885 has been updated by Yui NARUSE.
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 r49708 merged revision(s) 49685,49687.
----------------------------------------
Bug #10885: Segmentation fault when calling refined method in duplicate module
https://bugs.ruby-lang.org/issues/10885#change-51625
* Author: Kazuki Tsujimoto
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-02-22) [x86_64-linux]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE
----------------------------------------
以下のコードでSEGVします。
Moduleをdupする時にcrefをコピーしていますが、その中でnd_refinementsを設定していないのが原因です。
~~~ruby
module M
refine BasicObject do
def __id__
end
end
class << self
def m
__id__
end
end
end
M.dup.m
~~~
--
https://bugs.ruby-lang.org/