1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-06-28 22:51:06 +03:00

b2/: handle attempts to break/continue (in substitutions) without a block

This commit is contained in:
Werner Almesberger 2012-06-03 20:54:08 -03:00
parent e56a71e914
commit ddbf80b542
2 changed files with 13 additions and 0 deletions

View File

@ -395,6 +395,8 @@ static void recurse_fin(struct subst *sub, const struct parent *parent)
case st_break:
/* fall through */
case st_continue:
if (!parent)
yyerror("jump without block");
sub->u.jump = resolve_jump(sub->u.tmp, parent);
break;
default:

View File

@ -126,4 +126,15 @@ expect <<EOF
s:8: cannot find "z"
EOF
#------------------------------------------------------------------------------
tst_fail "substitutions: continue without block" -q <<EOF
!-s
continue
EOF
expect <<EOF
s:2: jump without block
EOF
###############################################################################