Skip to content

Commit

Permalink
updated for version 7.3.623
Browse files Browse the repository at this point in the history
Problem:    Perl 5.14 commands crash Vim on MS-Windows.
Solution:   Use perl_get_sv() instead of GvSV(). (Raymond Ko)
  • Loading branch information
brammool committed Aug 8, 2012
1 parent 953a3ee commit f37fbed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/if_perl.xs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
# define EXTERN_C
#endif

#if (PERL_REVISION == 5) && (PERL_VERSION >= 14) && defined(_MSC_VER)
/* Using PL_errgv to get the error message after perl_eval_sv() causes a crash
* with MSVC and Perl version 5.14. */
# define AVOID_PL_ERRGV
#endif

/* Compatibility hacks over */

static PerlInterpreter *perl_interp = NULL;
Expand Down Expand Up @@ -796,7 +802,11 @@ ex_perl(eap)

SvREFCNT_dec(sv);

#ifdef AVOID_PL_ERRGV
err = SvPV(perl_get_sv("@", GV_ADD), length);
#else
err = SvPV(GvSV(PL_errgv), length);
#endif

FREETMPS;
LEAVE;
Expand Down Expand Up @@ -866,7 +876,11 @@ ex_perldo(eap)
sv_catpvn(sv, "}", 1);
perl_eval_sv(sv, G_DISCARD | G_NOARGS);
SvREFCNT_dec(sv);
#ifdef AVOID_PL_ERRGV
str = SvPV(perl_get_sv("@", GV_ADD), length);
#else
str = SvPV(GvSV(PL_errgv), length);
#endif
if (length)
goto err;

Expand All @@ -880,7 +894,11 @@ ex_perldo(eap)
sv_setpv(GvSV(PL_defgv), (char *)ml_get(i));
PUSHMARK(sp);
perl_call_pv("VIM::perldo", G_SCALAR | G_EVAL);
#ifdef AVOID_PL_ERRGV
str = SvPV(perl_get_sv("@", GV_ADD), length);
#else
str = SvPV(GvSV(PL_errgv), length);
#endif
if (length)
break;
SPAGAIN;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
623,
/**/
622,
/**/
Expand Down

0 comments on commit f37fbed

Please sign in to comment.