aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-16 19:10:38 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-16 19:10:38 +0100
commit6d29879c676a636656c7b29ab5be76518346b19c (patch)
treec8fd67144b41ef0ccd334a5c981342e32d1bc815
parent9dc5d08baa4f409b2b6f9b98e2eefd87b8eb29be (diff)
downloadbusybox-w32-6d29879c676a636656c7b29ab5be76518346b19c.tar.gz
busybox-w32-6d29879c676a636656c7b29ab5be76518346b19c.tar.bz2
busybox-w32-6d29879c676a636656c7b29ab5be76518346b19c.zip
bc: fold bc_parse_noElse() into its only caller
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--miscutils/bc.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 0e61642a7..cca64eaf5 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -4112,23 +4112,12 @@ static BC_STATUS zbc_parse_return(BcParse *p)
4112# define zbc_parse_return(...) (zbc_parse_return(__VA_ARGS__), BC_STATUS_SUCCESS) 4112# define zbc_parse_return(...) (zbc_parse_return(__VA_ARGS__), BC_STATUS_SUCCESS)
4113#endif 4113#endif
4114 4114
4115static void bc_parse_noElse(BcParse *p)
4116{
4117 BcInstPtr *ip;
4118 size_t *label;
4119
4120 ip = bc_vec_top(&p->exits);
4121 label = bc_vec_item(&p->func->labels, ip->idx);
4122 dbg_lex("%s:%d rewriting label: %d -> %d", __func__, __LINE__, *label, p->func->code.len);
4123 *label = p->func->code.len;
4124
4125 bc_vec_pop(&p->exits);
4126}
4127
4128static BC_STATUS zbc_parse_else(BcParse *p) 4115static BC_STATUS zbc_parse_else(BcParse *p)
4129{ 4116{
4130 BcStatus s; 4117 BcStatus s;
4131 BcInstPtr ip; 4118 BcInstPtr ip;
4119 BcInstPtr *ipp;
4120 size_t *label;
4132 4121
4133 dbg_lex_enter("%s:%d entered", __func__, __LINE__); 4122 dbg_lex_enter("%s:%d entered", __func__, __LINE__);
4134 4123
@@ -4139,8 +4128,11 @@ static BC_STATUS zbc_parse_else(BcParse *p)
4139 bc_parse_push(p, BC_INST_JUMP); 4128 bc_parse_push(p, BC_INST_JUMP);
4140 bc_parse_pushIndex(p, ip.idx); 4129 bc_parse_pushIndex(p, ip.idx);
4141 4130
4142 dbg_lex("%s:%d calling bc_parse_noElse()", __func__, __LINE__); 4131 ipp = bc_vec_top(&p->exits);
4143 bc_parse_noElse(p); 4132 label = bc_vec_item(&p->func->labels, ipp->idx);
4133 dbg_lex("%s:%d rewriting label: %d -> %d", __func__, __LINE__, *label, p->func->code.len);
4134 *label = p->func->code.len;
4135 bc_vec_pop(&p->exits);
4144 4136
4145 bc_vec_push(&p->exits, &ip); 4137 bc_vec_push(&p->exits, &ip);
4146 bc_vec_push(&p->func->labels, &ip.idx); 4138 bc_vec_push(&p->func->labels, &ip.idx);