diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-06-16 19:43:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-06-16 19:51:01 +0200 |
commit | e1279858394a6079be6816cbedaa3f10e74057cc (patch) | |
tree | 7a7a032ea71978437c8888c9f508db1d4fdf4fe3 /shell/math.h | |
parent | f8263528cd44ac5dc95778556c6fd3feea14742e (diff) | |
download | busybox-w32-e1279858394a6079be6816cbedaa3f10e74057cc.tar.gz busybox-w32-e1279858394a6079be6816cbedaa3f10e74057cc.tar.bz2 busybox-w32-e1279858394a6079be6816cbedaa3f10e74057cc.zip |
shell/math: fix ?: to not evaluate not-taken branches
This fixes ash-arith-arith-ternary1/2.tests
function old new delta
evaluate_string 1271 1432 +161
arith_apply 968 1000 +32
arith 22 36 +14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 207/0) Total: 207 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/math.h')
-rw-r--r-- | shell/math.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/shell/math.h b/shell/math.h index 41ef6e8df..452ddaddd 100644 --- a/shell/math.h +++ b/shell/math.h | |||
@@ -73,13 +73,12 @@ typedef long arith_t; | |||
73 | 73 | ||
74 | typedef const char* FAST_FUNC (*arith_var_lookup_t)(const char *name); | 74 | typedef const char* FAST_FUNC (*arith_var_lookup_t)(const char *name); |
75 | typedef void FAST_FUNC (*arith_var_set_t)(const char *name, const char *val); | 75 | typedef void FAST_FUNC (*arith_var_set_t)(const char *name, const char *val); |
76 | //typedef const char* FAST_FUNC (*arith_var_endofname_t)(const char *name); | ||
77 | 76 | ||
78 | typedef struct arith_state_t { | 77 | typedef struct arith_state_t { |
79 | const char *errmsg; | 78 | const char *errmsg; |
80 | arith_var_lookup_t lookupvar; | 79 | arith_var_lookup_t lookupvar; |
81 | arith_var_set_t setvar; | 80 | arith_var_set_t setvar; |
82 | // arith_var_endofname_t endofname; | 81 | uint64_t evaluation_disabled; |
83 | void *list_of_recursed_names; | 82 | void *list_of_recursed_names; |
84 | } arith_state_t; | 83 | } arith_state_t; |
85 | 84 | ||