mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-04 23:05:21 +02:00
b2/: handle attempts to break/continue (in substitutions) without a block
This commit is contained in:
parent
e56a71e914
commit
ddbf80b542
@ -395,6 +395,8 @@ static void recurse_fin(struct subst *sub, const struct parent *parent)
|
|||||||
case st_break:
|
case st_break:
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case st_continue:
|
case st_continue:
|
||||||
|
if (!parent)
|
||||||
|
yyerror("jump without block");
|
||||||
sub->u.jump = resolve_jump(sub->u.tmp, parent);
|
sub->u.jump = resolve_jump(sub->u.tmp, parent);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -126,4 +126,15 @@ expect <<EOF
|
|||||||
s:8: cannot find "z"
|
s:8: cannot find "z"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
tst_fail "substitutions: continue without block" -q <<EOF
|
||||||
|
!-s
|
||||||
|
continue
|
||||||
|
EOF
|
||||||
|
|
||||||
|
expect <<EOF
|
||||||
|
s:2: jump without block
|
||||||
|
EOF
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user