summaryrefslogtreecommitdiff
path: root/op.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 /op.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 'op.c')
-rw-r--r--op.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/op.c b/op.c
index 1fd94c2e2f..ef05f5b3db 100644
--- a/op.c
+++ b/op.c
@@ -2183,22 +2183,8 @@ Perl_fold_constants(pTHX_ register OP *o)
PL_op = curop;
oldscope = PL_scopestack_ix;
+ create_eval_scope(G_FAKINGEVAL);
- /* 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;
- sv_setpvn(ERRSV,"",0);
- }
JMPENV_PUSH(ret);
switch (ret) {
@@ -2225,21 +2211,9 @@ Perl_fold_constants(pTHX_ register OP *o)
}
JMPENV_POP;
- 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();
if (ret)
goto nope;