summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
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) {