summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-03-27 21:04:58 +0000
committerNicholas Clark <nick@ccl4.org>2006-03-27 21:04:58 +0000
commitedb2152a8435aa2e1308442c03e82c10e128574e (patch)
tree1bcabf13cf8ae1ef3c9cb44c06c2a1b617e7fb20 /perl.c
parenta5871da3a494d85e46d501e1e38f3d4b9d0f0c01 (diff)
downloadperl-edb2152a8435aa2e1308442c03e82c10e128574e.tar.gz
Merge the cut & paste code from Perl_call_sv/Perl_fold_constants with
the near identical code in pp_entertry into Perl_create_eval_scope. Move the cut & paste code from Perl_call_sv/Perl_fold_constants into Perl_delete_eval_scope. p4raw-id: //depot/perl@27617
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/perl.c b/perl.c
index a98314b49e..7e0f842233 100644
--- a/perl.c
+++ b/perl.c
@@ -2604,27 +2604,11 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
else {
myop.op_other = (OP*)&myop;
PL_markstack_ptr--;
- /* we're trying to emulate pp_entertry() here */
- {
- register PERL_CONTEXT *cx;
- const I32 gimme = GIMME_V;
-
- ENTER;
- SAVETMPS;
-
- PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), PL_stack_sp);
- PUSHEVAL(cx, 0, 0);
- PL_eval_root = PL_op; /* Only needed so that goto works right. */
-
- PL_in_eval = EVAL_INEVAL;
- if (flags & G_KEEPERR)
- PL_in_eval |= EVAL_KEEPERR;
- else
- sv_setpvn(ERRSV,"",0);
- }
+ create_eval_scope(flags|G_FAKINGEVAL);
PL_markstack_ptr++;
JMPENV_PUSH(ret);
+
switch (ret) {
case 0:
redo_body:
@@ -2661,21 +2645,8 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
break;
}
- if (PL_scopestack_ix > oldscope) {
- SV **newsp;
- PMOP *newpm;
- I32 gimme;
- register PERL_CONTEXT *cx;
- I32 optype;
-
- POPBLOCK(cx,newpm);
- POPEVAL(cx);
- PL_curpm = newpm;
- LEAVE;
- PERL_UNUSED_VAR(newsp);
- PERL_UNUSED_VAR(gimme);
- PERL_UNUSED_VAR(optype);
- }
+ if (PL_scopestack_ix > oldscope)
+ delete_eval_scope();
JMPENV_POP;
}