I have this patch for a while, but the test still crashes Vim when using
dynamic loading.  I hope someone knows a solution.


*** ../vim-8.0.1216/src/if_ruby.c       2017-09-26 21:21:39.974051309 +0200
--- src/if_ruby.c       2017-10-19 21:24:17.221719306 +0200
***************
*** 251,257 ****
  # endif
  # define rb_lastline_get                      dll_rb_lastline_get
  # define rb_lastline_set                      dll_rb_lastline_set
! # define rb_load_protect                      dll_rb_load_protect
  # ifndef RUBY19_OR_LATER
  #  define rb_num2long                 dll_rb_num2long
  # endif
--- 251,258 ----
  # endif
  # define rb_lastline_get                      dll_rb_lastline_get
  # define rb_lastline_set                      dll_rb_lastline_set
! # define rb_protect                   dll_rb_protect
! # define rb_load                      dll_rb_load
  # ifndef RUBY19_OR_LATER
  #  define rb_num2long                 dll_rb_num2long
  # endif
***************
*** 376,382 ****
  # endif
  static VALUE (*dll_rb_lastline_get) (void);
  static void (*dll_rb_lastline_set) (VALUE);
! static void (*dll_rb_load_protect) (VALUE, int, int*);
  static long (*dll_rb_num2long) (VALUE);
  static unsigned long (*dll_rb_num2ulong) (VALUE);
  static VALUE (*dll_rb_obj_alloc) (VALUE);
--- 377,384 ----
  # endif
  static VALUE (*dll_rb_lastline_get) (void);
  static void (*dll_rb_lastline_set) (VALUE);
! static void (*dll_rb_protect) (VALUE (*)(VALUE), int, int*);
! static void (*dll_rb_load) (VALUE, int);
  static long (*dll_rb_num2long) (VALUE);
  static unsigned long (*dll_rb_num2ulong) (VALUE);
  static VALUE (*dll_rb_obj_alloc) (VALUE);
***************
*** 568,574 ****
  # endif
      {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get},
      {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set},
!     {"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect},
      {"rb_num2long", (RUBY_PROC*)&dll_rb_num2long},
      {"rb_num2ulong", (RUBY_PROC*)&dll_rb_num2ulong},
      {"rb_obj_alloc", (RUBY_PROC*)&dll_rb_obj_alloc},
--- 570,577 ----
  # endif
      {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get},
      {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set},
!     {"rb_protect", (RUBY_PROC*)&dll_rb_protect},
!     {"rb_load", (RUBY_PROC*)&dll_rb_load},
      {"rb_num2long", (RUBY_PROC*)&dll_rb_num2long},
      {"rb_num2ulong", (RUBY_PROC*)&dll_rb_num2ulong},
      {"rb_obj_alloc", (RUBY_PROC*)&dll_rb_obj_alloc},
***************
*** 831,837 ****
  
      if (ensure_ruby_initialized())
      {
!       rb_load_protect(rb_str_new2((char *) eap->arg), 0, &state);
        if (state) error_print(state);
      }
  }
--- 834,841 ----
  
      if (ensure_ruby_initialized())
      {
!       rb_protect((VALUE (*)(VALUE))rb_load, rb_str_new2((char *)eap->arg),
!                                                                      &state);
        if (state) error_print(state);
      }
  }
*** ../vim-8.0.1216/src/testdir/test_ruby.vim   2017-01-29 23:11:21.172512839 
+0100
--- src/testdir/test_ruby.vim   2017-10-21 19:17:06.040153912 +0200
***************
*** 49,51 ****
--- 49,59 ----
    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


-- 
FATHER:    You killed eight wedding guests in all!
LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady.
FATHER:    I can understand that.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui