0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.0.1448: segfault with exception inside :rubyfile command

Problem:    Segmentation fault when Ruby throws an exception inside :rubyfile
            command.
Solution:   Use rb_protect() instead of rb_load_protect(). (ujihisa,
            closes #2147, greywolf, closes #2512, #2511)
This commit is contained in:
Bram Moolenaar
2018-01-31 20:15:30 +01:00
parent cada78975e
commit 37badc898b
3 changed files with 21 additions and 4 deletions

View File

@@ -49,3 +49,11 @@ func Test_rubydo()
bwipe!
bwipe!
endfunc
func Test_rubyfile()
" Check :rubyfile does not SEGV with Ruby level exception but just fails
let tempfile = tempname() . '.rb'
call writefile(['raise "vim!"'], tempfile)
call assert_fails('rubyfile ' . tempfile)
call delete(tempfile)
endfunc