summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-02-10 13:21:37 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-02-12 03:09:58 +0000
commitf46d017c815b0d11f074ad6c16247c01f8af2ece (patch)
treeb47db1bbab27e93a3f24e5114c769c4c8ebe7351 /pp_ctl.c
parent301d9039fb19ffce344369e333240632e80d95d5 (diff)
downloadperl-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 'pp_ctl.c')
-rw-r--r--pp_ctl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 33247e3edd..e5ddebefd1 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2629,6 +2629,7 @@ PP(pp_leaveeval)
assert(CvDEPTH(compcv) == 1);
#endif
CvDEPTH(compcv) = 0;
+ lex_end();
if (optype == OP_REQUIRE &&
!(gimme == G_SCALAR ? SvTRUE(*sp) : sp > newsp))
@@ -2637,13 +2638,13 @@ PP(pp_leaveeval)
char *name = cx->blk_eval.old_name;
(void)hv_delete(GvHVn(incgv), name, strlen(name), G_DISCARD);
retop = die("%s did not return a true value", name);
+ /* die_where() did LEAVE, or we won't be here */
+ }
+ else {
+ LEAVE;
+ if (!(save_flags & OPf_SPECIAL))
+ sv_setpv(ERRSV,"");
}
-
- lex_end();
- LEAVE;
-
- if (!(save_flags & OPf_SPECIAL))
- sv_setpv(ERRSV,"");
RETURNOP(retop);
}