[ruby-dev:48907] [Ruby trunk - Bug #10885] Segmentation fault when calling refined method in duplicate module
From:
nagachika00@...
Date:
2015-03-17 17:34:27 UTC
List:
ruby-dev #48907
Issue #10885 has been updated by Tomoyuki Chikanaga.
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 r49995.
----------------------------------------
Bug #10885: Segmentation fault when calling refined method in duplicate module
https://bugs.ruby-lang.org/issues/10885#change-51867
* Author: Kazuki Tsujimoto
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-02-22) [x86_64-linux]
* Backport: 2.0.0: DONE, 2.1: DONE, 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/