[win32] Sync yet another patch (this one manually edited):
Gurusamy Sarathy [Tue, 28 Oct 1997 21:51:25 +0000 (16:51 -0500)]
    Message-Id: <199710290251.VAA14362@aatma.engin.umich.edu>
    Subject: [PATCH] Re: local($@) gives core dump

p4raw-id: //depot/win32/perl@308

pp_ctl.c

index d9f985e..834f0c0 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1050,11 +1050,14 @@ die_where(char *message)
            if (svp) {
                if (!SvIOK(*svp)) {
                    static char prefix[] = "\t(in cleanup) ";
+                   SV *err = ERRSV;
                    sv_upgrade(*svp, SVt_IV);
                    (void)SvIOK_only(*svp);
-                   SvGROW(ERRSV, SvCUR(ERRSV)+sizeof(prefix)+klen);
-                   sv_catpvn(ERRSV, prefix, sizeof(prefix)-1);
-                   sv_catpvn(ERRSV, message, klen);
+                   if (!SvPOK(err))
+                       sv_setpv(err,"");
+                   SvGROW(err, SvCUR(err)+sizeof(prefix)+klen);
+                   sv_catpvn(err, prefix, sizeof(prefix)-1);
+                   sv_catpvn(err, message, klen);
                }
                sv_inc(*svp);
            }