bc: simplify zbc_parse_break_or_continue(), logic is the same
function old new delta zbc_parse_stmt_possibly_auto 2259 2224 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-35) Total: -35 bytes text data bss dec hex filename 982218 485 7296 989999 f1b2f busybox_old 982183 485 7296 989964 f1b0c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
a50576a415
commit
563d93c9a4
@ -4358,20 +4358,19 @@ static BC_STATUS zbc_parse_break_or_continue(BcParse *p, BcLexType type)
|
|||||||
{
|
{
|
||||||
BcStatus s;
|
BcStatus s;
|
||||||
size_t i;
|
size_t i;
|
||||||
BcInstPtr *ip;
|
|
||||||
|
|
||||||
if (type == BC_LEX_KEY_BREAK) {
|
if (type == BC_LEX_KEY_BREAK) {
|
||||||
if (p->exits.len == 0) RETURN_STATUS(bc_error_bad_token());
|
BcInstPtr *ipp;
|
||||||
|
|
||||||
i = p->exits.len - 1;
|
i = p->exits.len;
|
||||||
ip = bc_vec_item(&p->exits, i);
|
for (;;) {
|
||||||
|
if (i == 0) // none of the enclosing blocks is a loop
|
||||||
while (!ip->func && i < p->exits.len)
|
RETURN_STATUS(bc_error_bad_token());
|
||||||
ip = bc_vec_item(&p->exits, i--);
|
ipp = bc_vec_item(&p->exits, --i);
|
||||||
if (i >= p->exits.len && !ip->func)
|
if (ipp->func != 0)
|
||||||
RETURN_STATUS(bc_error_bad_token());
|
break;
|
||||||
|
}
|
||||||
i = ip->idx;
|
i = ipp->idx;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
i = *((size_t *) bc_vec_top(&p->conds));
|
i = *((size_t *) bc_vec_top(&p->conds));
|
||||||
|
Loading…
Reference in New Issue
Block a user