bc: shorten sanity-check code
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 22 Dec 2018 13:18:47 +0000 (14:18 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 22 Dec 2018 13:18:47 +0000 (14:18 +0100)
function                                             old     new   delta
zbc_vm_process                                       745     740      -5

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

index 29007d8288a8a529e8dc771bcaa204b7eec5c10a..bb83e0a142c53126d70cf538f4cb3b8086a5b1c3 100644 (file)
@@ -6678,9 +6678,9 @@ static BC_STATUS zbc_vm_process(const char *text)
                        BcInstPtr *ip = (void*)G.prog.exestack.v;
 
 #if SANITY_CHECKS
-                       if (G.prog.results.len != 0)
-                               bb_error_msg_and_die("data stack not empty: %d slots", G.prog.results.len);
-                       if (G.prog.exestack.len != 1) // should be empty
+                       if (G.prog.results.len != 0) // should be empty
+                               bb_error_msg_and_die("BUG:data stack");
+                       if (G.prog.exestack.len != 1) // should have only main's IP
                                bb_error_msg_and_die("BUG:call stack");
                        if (ip->func != BC_PROG_MAIN)
                                bb_error_msg_and_die("BUG:not MAIN");