Karsten Hopp 43b081
To: vim_dev@googlegroups.com
Karsten Hopp 43b081
Subject: Patch 7.3.623
Karsten Hopp 43b081
Fcc: outbox
Karsten Hopp 43b081
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 43b081
Mime-Version: 1.0
Karsten Hopp 43b081
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 43b081
Content-Transfer-Encoding: 8bit
Karsten Hopp 43b081
------------
Karsten Hopp 43b081
Karsten Hopp 43b081
Patch 7.3.623
Karsten Hopp 43b081
Problem:    Perl 5.14 commands crash Vim on MS-Windows.
Karsten Hopp 43b081
Solution:   Use perl_get_sv() instead of GvSV(). (Raymond Ko)
Karsten Hopp 43b081
Files:	    src/if_perl.xs
Karsten Hopp 43b081
Karsten Hopp 43b081
Karsten Hopp 43b081
*** ../vim-7.3.622/src/if_perl.xs	2012-03-16 19:34:43.000000000 +0100
Karsten Hopp 43b081
--- src/if_perl.xs	2012-08-08 13:15:29.000000000 +0200
Karsten Hopp 43b081
***************
Karsten Hopp 43b081
*** 76,81 ****
Karsten Hopp 43b081
--- 76,87 ----
Karsten Hopp 43b081
  # define EXTERN_C
Karsten Hopp 43b081
  #endif
Karsten Hopp 43b081
  
Karsten Hopp 43b081
+ #if (PERL_REVISION == 5) && (PERL_VERSION >= 14) && defined(_MSC_VER)
Karsten Hopp 43b081
+ /* Using PL_errgv to get the error message after perl_eval_sv() causes a crash
Karsten Hopp 43b081
+  * with MSVC and Perl version 5.14. */
Karsten Hopp 43b081
+ # define AVOID_PL_ERRGV
Karsten Hopp 43b081
+ #endif
Karsten Hopp 43b081
+ 
Karsten Hopp 43b081
  /* Compatibility hacks over */
Karsten Hopp 43b081
  
Karsten Hopp 43b081
  static PerlInterpreter *perl_interp = NULL;
Karsten Hopp 43b081
***************
Karsten Hopp 43b081
*** 796,802 ****
Karsten Hopp 43b081
--- 802,812 ----
Karsten Hopp 43b081
  
Karsten Hopp 43b081
      SvREFCNT_dec(sv);
Karsten Hopp 43b081
  
Karsten Hopp 43b081
+ #ifdef AVOID_PL_ERRGV
Karsten Hopp 43b081
+     err = SvPV(perl_get_sv("@", GV_ADD), length);
Karsten Hopp 43b081
+ #else
Karsten Hopp 43b081
      err = SvPV(GvSV(PL_errgv), length);
Karsten Hopp 43b081
+ #endif
Karsten Hopp 43b081
  
Karsten Hopp 43b081
      FREETMPS;
Karsten Hopp 43b081
      LEAVE;
Karsten Hopp 43b081
***************
Karsten Hopp 43b081
*** 866,872 ****
Karsten Hopp 43b081
--- 876,886 ----
Karsten Hopp 43b081
      sv_catpvn(sv, "}", 1);
Karsten Hopp 43b081
      perl_eval_sv(sv, G_DISCARD | G_NOARGS);
Karsten Hopp 43b081
      SvREFCNT_dec(sv);
Karsten Hopp 43b081
+ #ifdef AVOID_PL_ERRGV
Karsten Hopp 43b081
+     str = SvPV(perl_get_sv("@", GV_ADD), length);
Karsten Hopp 43b081
+ #else
Karsten Hopp 43b081
      str = SvPV(GvSV(PL_errgv), length);
Karsten Hopp 43b081
+ #endif
Karsten Hopp 43b081
      if (length)
Karsten Hopp 43b081
  	goto err;
Karsten Hopp 43b081
  
Karsten Hopp 43b081
***************
Karsten Hopp 43b081
*** 880,886 ****
Karsten Hopp 43b081
--- 894,904 ----
Karsten Hopp 43b081
  	sv_setpv(GvSV(PL_defgv), (char *)ml_get(i));
Karsten Hopp 43b081
  	PUSHMARK(sp);
Karsten Hopp 43b081
  	perl_call_pv("VIM::perldo", G_SCALAR | G_EVAL);
Karsten Hopp 43b081
+ #ifdef AVOID_PL_ERRGV
Karsten Hopp 43b081
+ 	str = SvPV(perl_get_sv("@", GV_ADD), length);
Karsten Hopp 43b081
+ #else
Karsten Hopp 43b081
  	str = SvPV(GvSV(PL_errgv), length);
Karsten Hopp 43b081
+ #endif
Karsten Hopp 43b081
  	if (length)
Karsten Hopp 43b081
  	    break;
Karsten Hopp 43b081
  	SPAGAIN;
Karsten Hopp 43b081
*** ../vim-7.3.622/src/version.c	2012-08-02 21:48:20.000000000 +0200
Karsten Hopp 43b081
--- src/version.c	2012-08-08 13:08:10.000000000 +0200
Karsten Hopp 43b081
***************
Karsten Hopp 43b081
*** 716,717 ****
Karsten Hopp 43b081
--- 716,719 ----
Karsten Hopp 43b081
  {   /* Add new patch number below this line */
Karsten Hopp 43b081
+ /**/
Karsten Hopp 43b081
+     623,
Karsten Hopp 43b081
  /**/
Karsten Hopp 43b081
Karsten Hopp 43b081
-- 
Karsten Hopp 43b081
Don't be humble ... you're not that great.
Karsten Hopp 43b081
                      -- Golda Meir
Karsten Hopp 43b081
Karsten Hopp 43b081
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 43b081
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 43b081
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 43b081
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///