diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2012-11-23 08:02:18 +0100 |
---|---|---|
committer | Steffen Mueller <smueller@cpan.org> | 2012-11-23 08:02:18 +0100 |
commit | ed1786ad0de26936e72cd6e81aa3bd3d3eb9cae1 (patch) | |
tree | f6cb0190b539f6888c0ffe2ce7eb16bd82890cac /perl.c | |
parent | 8b0640a101c890210fd27854781518df34e46f75 (diff) | |
download | perl-ed1786ad0de26936e72cd6e81aa3bd3d3eb9cae1.tar.gz |
Reduce scope of SP in Perl_eval_pv
This commit has no effect on machine code, since dSP has no calls and
is removed as dead code by the compiler since SP is never read until after
the SPAGAIN. By reducing the scope of SP, accidentally lengthing SP's
liveness won't happen and also the code makes a little bit more sense than
the SPAGAIN which for a sec makes you think SVs were put on the Perl
stack before the eval_sv call. Clarity is the purpose.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -2892,7 +2892,6 @@ SV* Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) { dVAR; - dSP; SV* sv = newSVpv(p, 0); PERL_ARGS_ASSERT_EVAL_PV; @@ -2900,9 +2899,11 @@ Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) eval_sv(sv, G_SCALAR); SvREFCNT_dec(sv); - SPAGAIN; - sv = POPs; - PUTBACK; + { + dSP; + sv = POPs; + PUTBACK; + } if (croak_on_error && SvTRUE(ERRSV)) { Perl_croak(aTHX_ "%s", SvPVx_nolen_const(ERRSV)); |