summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGerard Goossen <gerard@ggoossen.net>2009-11-21 12:16:07 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-11-21 19:49:48 +0100
commitb500e03bf95eb884a53407409b4e755d303171a4 (patch)
tree2ea466912e5adede52f4d5b2907358ab8f9602cc /pp_ctl.c
parent021f53de09926928546378b3552f9240c9241dde (diff)
downloadperl-b500e03bf95eb884a53407409b4e755d303171a4.tar.gz
deprecate "goto" to jump into a construct
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 8074b9fed6..cd099c8825 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2698,6 +2698,12 @@ PP(pp_goto)
DIE(aTHX_ "Can't \"goto\" into the middle of a foreach loop");
}
+ if (*enterops && enterops[1]) {
+ I32 i = enterops[1]->op_type == OP_ENTER && in_block ? 2 : 1;
+ if (enterops[i])
+ deprecate("\"goto\" to jump into a construct");
+ }
+
/* pop unwanted frames */
if (ix < cxstack_ix) {