diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-10 13:21:37 -0500 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-12 03:09:58 +0000 |
commit | f46d017c815b0d11f074ad6c16247c01f8af2ece (patch) | |
tree | b47db1bbab27e93a3f24e5114c769c4c8ebe7351 /scope.c | |
parent | 301d9039fb19ffce344369e333240632e80d95d5 (diff) | |
download | perl-f46d017c815b0d11f074ad6c16247c01f8af2ece.tar.gz |
[win32] fix extra LEAVE when require fails
Message-Id: <199802102321.SAA15346@aatma.engin.umich.edu>
Subject: Re: evals and requires make seg-fault with bad require file
p4raw-id: //depot/win32/perl@498
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -258,12 +258,11 @@ void save_item(register SV *item) { dTHR; - register SV *sv; + register SV *sv = NEWSV(0,0); + sv_setsv(sv,item); SSCHECK(3); SSPUSHPTR(item); /* remember the pointer */ - sv = NEWSV(0,0); - sv_setsv(sv,item); SSPUSHPTR(sv); /* remember the value */ SSPUSHINT(SAVEt_ITEM); } @@ -440,11 +439,11 @@ save_list(register SV **sarg, I32 maxsarg) register SV *sv; register I32 i; - SSCHECK(3 * maxsarg); for (i = 1; i <= maxsarg; i++) { - SSPUSHPTR(sarg[i]); /* remember the pointer */ sv = NEWSV(0,0); sv_setsv(sv,sarg[i]); + SSCHECK(3); + SSPUSHPTR(sarg[i]); /* remember the pointer */ SSPUSHPTR(sv); /* remember the value */ SSPUSHINT(SAVEt_ITEM); } @@ -607,14 +606,14 @@ leave_scope(I32 base) case SAVEt_GP: /* scalar reference */ ptr = SSPOPPTR; gv = (GV*)SSPOPPTR; - gp_free(gv); - GvGP(gv) = (GP*)ptr; if (SvPOK(gv) && SvLEN(gv) > 0) { Safefree(SvPVX(gv)); } SvPVX(gv) = (char *)SSPOPPTR; SvCUR(gv) = (STRLEN)SSPOPIV; SvLEN(gv) = (STRLEN)SSPOPIV; + gp_free(gv); + GvGP(gv) = (GP*)ptr; SvREFCNT_dec(gv); break; case SAVEt_FREESV: |