diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-11 18:40:49 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-11 18:40:49 +0000 |
commit | b45de488d87a3fe293c21579bc4d11fe89c10fb3 (patch) | |
tree | 6ffdf145ec9243aea5139911d8eb987db4697353 /pp_ctl.c | |
parent | 1d76a5c36fe33e7755afd0f03faf19826beda303 (diff) | |
download | perl-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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(); } |