diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-03 11:54:22 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-03 11:54:22 +0900 |
| commit | e673fbb35a0c439bb4685cd0a6784f93a4856c07 (patch) | |
| tree | 929a0c00c4720e0670110cc9601bf2fcc2c7b442 /test | |
| parent | d7589b10ed0011c41f007fa9bfdba7c529fc6b71 (diff) | |
| parent | 1ff4b3f800d369510658b7926a1d6dc9327d0422 (diff) | |
| download | mruby-e673fbb35a0c439bb4685cd0a6784f93a4856c07.tar.gz mruby-e673fbb35a0c439bb4685cd0a6784f93a4856c07.zip | |
Merge pull request #3321 from clayton-shopify/fix-proc-crash-upstream
Fix segfault in mrb_proc_copy.
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/proc.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/t/proc.rb b/test/t/proc.rb index bc9821f7c..29530e8dd 100644 --- a/test/t/proc.rb +++ b/test/t/proc.rb @@ -163,3 +163,19 @@ assert('&obj call to_proc if defined') do assert_raise(TypeError){ mock(&(Object.new)) } end + +assert('initialize_copy works when initialize is removed') do + begin + Proc.alias_method(:old_initialize, :initialize) + Proc.remove_method(:initialize) + + a = Proc.new {} + b = Proc.new {} + assert_nothing_raised do + a.initialize_copy(b) + end + ensure + Proc.alias_method(:initialize, :old_initialize) + Proc.remove_method(:old_initialize) + end +end |
