diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-04-26 11:02:45 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-05-18 19:11:03 +0100 |
commit | 75f63940310204509f2935729c2b989e3be7c00d (patch) | |
tree | 4da30ce68217ea31dd520fafb4ddcaf5a333d6b7 /pp_ctl.c | |
parent | e72ec78c220651d4143e9b3398dd951c602d880e (diff) | |
download | perl-75f63940310204509f2935729c2b989e3be7c00d.tar.gz |
S_doparseform() should return void, not OP*, as it should use Perl_die not DIE
a1b950687051c32e added an error condition in S_doparseform() but used DIE(...)
to report it. DIE is defined as C<return Perl_die>, which acts as a hint to the
compiler about the control flow [as Perl_die() never returns], but also forces
the return type to be OP *. Whilst this is appropriate for pp functions, it's
not for S_doparseform() - a1b950687051c32e had to change the return type to OP*
and return NULL, just to appease DIE(). Hence use Perl_die() instead, remove
return statements, and remove the didn't-return-NULL (dead) code from
pp_formline.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -547,19 +547,16 @@ PP(pp_formline) bool item_is_utf8 = FALSE; bool targ_is_utf8 = FALSE; SV * nsv = NULL; - OP * parseres = NULL; const char *fmt; if (!SvMAGICAL(tmpForm) || !SvCOMPILED(tmpForm)) { if (SvREADONLY(tmpForm)) { SvREADONLY_off(tmpForm); - parseres = doparseform(tmpForm); + doparseform(tmpForm); SvREADONLY_on(tmpForm); } else - parseres = doparseform(tmpForm); - if (parseres) - return parseres; + doparseform(tmpForm); } SvPV_force(PL_formtarget, len); if (SvTAINTED(tmpForm)) @@ -4917,7 +4914,7 @@ PP(pp_break) RETURNOP(cx->blk_givwhen.leave_op); } -STATIC OP * +static void S_doparseform(pTHX_ SV *sv) { STRLEN len; @@ -5132,8 +5129,7 @@ S_doparseform(pTHX_ SV *sv) SvCOMPILED_on(sv); if (unchopnum && repeat) - DIE(aTHX_ "Repeated format line will never terminate (~~ and @#)"); - return 0; + Perl_die(aTHX_ "Repeated format line will never terminate (~~ and @#)"); } |