summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-11 18:40:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-11 18:40:49 +0000
commitb45de488d87a3fe293c21579bc4d11fe89c10fb3 (patch)
tree6ffdf145ec9243aea5139911d8eb987db4697353 /pp_ctl.c
parent1d76a5c36fe33e7755afd0f03faf19826beda303 (diff)
downloadperl-b45de488d87a3fe293c21579bc4d11fe89c10fb3.tar.gz
another long-standing eval bug: return doesn't reset $@ correctly
p4raw-id: //depot/perl@5660
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 533a7c364c..991af23780 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1784,6 +1784,7 @@ PP(pp_return)
I32 cxix;
register PERL_CONTEXT *cx;
bool popsub2 = FALSE;
+ bool clear_errsv = FALSE;
I32 gimme;
SV **newsp;
PMOP *newpm;
@@ -1814,6 +1815,8 @@ PP(pp_return)
popsub2 = TRUE;
break;
case CXt_EVAL:
+ if (!(PL_in_eval & EVAL_KEEPERR))
+ clear_errsv = TRUE;
POPEVAL(cx);
if (CxTRYBLOCK(cx))
break;
@@ -1875,6 +1878,8 @@ PP(pp_return)
LEAVE;
LEAVESUB(sv);
+ if (clear_errsv)
+ sv_setpv(ERRSV,"");
return pop_return();
}