summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-04-22 20:34:24 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-05-21 16:51:30 -0700
commit3532f34a665d9e3c45ae24b05a693150a285cde9 (patch)
treec69f02feba34af1aa0abb05acbbaa3b0b1148f99 /pp_ctl.c
parentc8f85248c653c2ed4452f5de552ef3f50c4a1120 (diff)
downloadperl-3532f34a665d9e3c45ae24b05a693150a285cde9.tar.gz
Produce the right error for goto "\0"
Since we have supported for embedded nulls in strings, we shouldn’t be using if(*label) to see whether label has a non-zero length. It’s probably not possible to get a null into a label, but we should still say ‘can’t find’ rather than ‘must have’ in that case.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 53f22f3409..8025d58f47 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3044,7 +3044,7 @@ PP(pp_goto)
else {
label = SvPV_const(sv, label_len);
label_flags = SvUTF8(sv);
- if (!(do_dump || *label))
+ if (!(do_dump || label_len))
DIE(aTHX_ must_have_label);
}
}
@@ -3056,12 +3056,12 @@ PP(pp_goto)
label = cPVOP->op_pv;
label_flags = (cPVOP->op_private & OPpPV_IS_UTF8) ? SVf_UTF8 : 0;
label_len = strlen(label);
- if (!(do_dump || *label)) DIE(aTHX_ must_have_label);
+ if (!(do_dump || label_len)) DIE(aTHX_ must_have_label);
}
PERL_ASYNC_CHECK();
- if (label && *label) {
+ if (label_len) {
OP *gotoprobe = NULL;
bool leaving_eval = FALSE;
bool in_block = FALSE;