bc: fix infinite state growth for "yes 1 | bc" case
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 21 Dec 2018 15:22:26 +0000 (16:22 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 21 Dec 2018 15:22:26 +0000 (16:22 +0100)
commit5d57bc442dfebefdd7db37c04fe2c9f1343bd08d
tree67f834c1ca2d6d1195bf0c3e177ebca24d1e3fd7
parent447dc02c2759e8c965dfcb3280b335b49a8c3a61
bc: fix infinite state growth for "yes 1 | bc" case

function                                             old     new   delta
zbc_vm_process                                       585     672     +87
bc_func_init                                          50      86     +36
zbc_program_num                                      990    1022     +32
bc_program_str                                        17      47     +30
bc_program_current_func                                -      22     +22
bc_parse_pushNUM                                      66      87     +21
bc_func_free                                          27      43     +16
zbc_num_binary                                       145     147      +2
bc_program_reset                                      64      61      -3
bc_parse_pushSTR                                      73      65      -8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 7/2 up/down: 246/-11)           Total: 235 bytes
   text    data     bss     dec     hex filename
 981393     485    7296  989174   f17f6 busybox_old
 981656     485    7296  989437   f18fd busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c