diff options
author | David Mitchell <davem@iabyn.com> | 2013-09-06 15:54:10 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-09-06 15:55:40 +0100 |
commit | 7d1d69cb1e59690060fc6368ef3969a206c87c50 (patch) | |
tree | 615334be551c467ec6248ec84ee1089f5d526554 /pp_ctl.c | |
parent | 127c4457c66a643f80802db7421deb38875cb3a5 (diff) | |
download | perl-7d1d69cb1e59690060fc6368ef3969a206c87c50.tar.gz |
pp_goto: document the different branches
Te various different forms of goto (and dump) take different branches
through this big function. Document which branches handle which variants.
Also document the use of OPf_SPECIAL in OP_DUMP.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2776,7 +2776,7 @@ S_dofindlabel(pTHX_ OP *o, const char *label, STRLEN len, U32 flags, OP **opstac return 0; } -PP(pp_goto) +PP(pp_goto) /* also pp_dump */ { dVAR; dSP; OP *retop = NULL; @@ -2791,6 +2791,8 @@ PP(pp_goto) static const char* const must_have_label = "goto must have label"; if (PL_op->op_flags & OPf_STACKED) { + /* goto EXPR or goto &foo */ + SV * const sv = POPs; SvGETMAGIC(sv); @@ -2986,11 +2988,13 @@ PP(pp_goto) } } else { + /* goto EXPR */ label = SvPV_nomg_const(sv, label_len); label_flags = SvUTF8(sv); } } else if (!(PL_op->op_flags & OPf_SPECIAL)) { + /* goto LABEL or dump LABEL */ label = cPVOP->op_pv; label_flags = (cPVOP->op_private & OPpPV_IS_UTF8) ? SVf_UTF8 : 0; label_len = strlen(label); |