Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/expr.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | struct lvalue | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | char *tokstr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | intmax_t tokval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | SHELL_VAR *tokvar; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | intmax_t ind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | int curtok, lasttok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | char *expression, *tp, *lasttp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | intmax_t tokval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | char *tokstr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | int noeval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | struct lvalue lval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | } EXPR_CONTEXT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | static char *expression; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | static char *tp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | static char *lasttp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | static int curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | static int lasttok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | static int assigntok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | static char *tokstr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | static intmax_t tokval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | static int noeval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | static sigjmp_buf evalbuf; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | static int already_expanded; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | static struct lvalue curlval = {0, 0, 0, -1}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | static struct lvalue lastlval = {0, 0, 0, -1}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | static int _is_arithop (int); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | static void readtok (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | static void init_lvalue (struct lvalue *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | static struct lvalue *alloc_lvalue (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | static void free_lvalue (struct lvalue *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
54 | static intmax_t expr_streval (char *, int, struct lvalue *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
55 | static intmax_t strlong (char *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
56 | static void evalerror (const char *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
57 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
58 | static void pushexp (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
59 | static void popexp (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
60 | static void expr_unwind (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
61 | static void expr_bind_variable (char *, char *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
62 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
63 | static void expr_bind_array_element (char *, arrayind_t, char *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
64 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
65 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
66 | static intmax_t subexpr (char *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
67 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
68 | static intmax_t expcomma (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
69 | static intmax_t expassign (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
70 | static intmax_t expcond (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
71 | static intmax_t explor (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
72 | static intmax_t expland (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
73 | static intmax_t expbor (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
74 | static intmax_t expbxor (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
75 | static intmax_t expband (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
76 | static intmax_t exp5 (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
77 | static intmax_t exp4 (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
78 | static intmax_t expshift (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
79 | static intmax_t exp3 (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
80 | static intmax_t exp2 (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
81 | static intmax_t exppower (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
82 | static intmax_t exp1 (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
83 | static intmax_t exp0 (void); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
84 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
85 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
86 | static EXPR_CONTEXT **expr_stack; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
87 | static int expr_depth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
88 | static int expr_stack_size; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
89 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
90 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
91 | extern const char * const bash_badsub_errmsg; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
92 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
93 | pushexp () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
94 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
95 | EXPR_CONTEXT *context; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
96 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
97 | if (expr_depth >= 1024
| 0-14508109 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
98 | evalerror ( never executed: evalerror ( dcgettext (((void *)0), "expression recursion level exceeded" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
99 | dcgettext (((void *)0), never executed: evalerror ( dcgettext (((void *)0), "expression recursion level exceeded" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
100 | "expression recursion level exceeded" never executed: evalerror ( dcgettext (((void *)0), "expression recursion level exceeded" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
101 | , 5) never executed: evalerror ( dcgettext (((void *)0), "expression recursion level exceeded" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
102 | ); never executed: evalerror ( dcgettext (((void *)0), "expression recursion level exceeded" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
103 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
104 | if (expr_depth >= expr_stack_size
| 4344-14503765 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
105 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
106 | expr_stack_size += 10; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
107 | expr_stack = (EXPR_CONTEXT **)sh_xrealloc((expr_stack), (expr_stack_size * sizeof (EXPR_CONTEXT *)), "expr.c", 268); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
108 | } executed 4344 times by 1 test: end of block Executed by:
| 4344 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
109 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
110 | context = (EXPR_CONTEXT *)sh_xmalloc((sizeof (EXPR_CONTEXT)), "expr.c", 271); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
111 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
112 | context->expression = expression; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
113 | do { (context)->curtok = curtok; (context)->lasttok = lasttok; (context)->tp = tp; (context)->lasttp = lasttp; (context)->tokval = tokval; (context)->tokstr = tokstr; (context)->noeval = noeval; (context)->lval = curlval; } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
115 | expr_stack[expr_depth++] = context; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
116 | } executed 14508109 times by 1 test: end of block Executed by:
| 14508109 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
117 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
118 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
119 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
120 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
121 | popexp () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
122 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
123 | EXPR_CONTEXT *context; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
124 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
125 | if (expr_depth <= 0
| 0-14507889 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
126 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
128 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
129 | expression = lasttp = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
130 | evalerror ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
131 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
132 | "recursion stack underflow" | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
133 | , 5) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
134 | ); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
135 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
136 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
137 | context = expr_stack[--expr_depth]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
138 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
139 | expression = context->expression; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
140 | do { curtok = (context)->curtok; lasttok = (context)->lasttok; tp = (context)->tp; lasttp = (context)->lasttp; tokval = (context)->tokval; tokstr = (context)->tokstr; noeval = (context)->noeval; curlval = (context)->lval; } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
141 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
142 | sh_xfree((context), "expr.c", 299); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
143 | } executed 14507889 times by 1 test: end of block Executed by:
| 14507889 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
144 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
145 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
146 | expr_unwind () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
147 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
148 | while (--
| 7-209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
149 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
150 | if (expr_stack[expr_depth]->tokstr
| 0-7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
151 | sh_xfree((expr_stack[expr_depth]->tokstr), "expr.c", 308); executed 7 times by 1 test: sh_xfree((expr_stack[expr_depth]->tokstr), "expr.c", 308); Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
152 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
153 | if (expr_stack[expr_depth]->expression
| 0-7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
154 | sh_xfree((expr_stack[expr_depth]->expression), "expr.c", 311); executed 7 times by 1 test: sh_xfree((expr_stack[expr_depth]->expression), "expr.c", 311); Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
156 | sh_xfree((expr_stack[expr_depth]), "expr.c", 313); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
157 | } executed 7 times by 1 test: end of block Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
158 | if (expr_depth == 0
| 0-209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
159 | sh_xfree((expr_stack[expr_depth]), "expr.c", 316); executed 209 times by 1 test: sh_xfree((expr_stack[expr_depth]), "expr.c", 316); Executed by:
| 209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
160 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
161 | noeval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
162 | } executed 209 times by 1 test: end of block Executed by:
| 209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
163 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
164 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
165 | expr_bind_variable (lhs, rhs) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
166 | char *lhs, *rhs; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
167 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
168 | SHELL_VAR *v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
169 | int aflags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
170 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
171 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
172 | aflags = (assoc_expand_once
| 0-7183335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
174 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
175 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
176 | v = bind_int_variable (lhs, rhs, aflags); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
177 | if (v
| 0-7183341 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
178 | siglongjmp((evalbuf), (1)); executed 2 times by 1 test: siglongjmp((evalbuf), (1)); Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
179 | stupidly_hack_special_variables (lhs); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
180 | } executed 7183345 times by 1 test: end of block Executed by:
| 7183345 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
181 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
185 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
186 | expr_bind_array_element (tok, ind, rhs) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
187 | char *tok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
188 | arrayind_t ind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
189 | char *rhs; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
190 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
191 | char *lhs, *vname; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
192 | size_t llen; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
193 | char ibuf[((sizeof (arrayind_t) * 8 - (! ((arrayind_t) 0 < (arrayind_t) -1))) * 302 / 1000 + 1 + (! ((arrayind_t) 0 < (arrayind_t) -1))) + 1], *istr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
195 | istr = fmtumax (ind, 10, ibuf, sizeof (ibuf), 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
196 | vname = array_variable_name (tok, 0, (char **) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
197 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
198 | , (int *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
199 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
200 | ); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
201 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
202 | llen = strlen (vname) + sizeof (ibuf) + 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
203 | lhs = sh_xmalloc((llen), "expr.c", 356); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
205 | sprintf (lhs, "%s[%s]", vname, istr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
206 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
207 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
208 | expr_bind_variable (lhs, rhs); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
209 | sh_xfree((vname), "expr.c", 362); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
210 | sh_xfree((lhs), "expr.c", 363); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
211 | } executed 10010 times by 1 test: end of block Executed by:
| 10010 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
212 | intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
213 | evalexp (expr, flags, validp) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
214 | char *expr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
215 | int flags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
216 | int *validp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
217 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
218 | intmax_t val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
219 | int c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
220 | sigjmp_buf oevalbuf; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
221 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
222 | val = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
223 | noeval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
224 | already_expanded = (flags&0x01); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
225 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
226 | __builtin_memcpy ((oevalbuf), (evalbuf), (sizeof (evalbuf))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
228 | c = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
229 | __sigsetjmp ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
230 | (evalbuf) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
231 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
232 | 0 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
233 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
234 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
235 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
236 | if (c
| 209-7256486 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
237 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
238 | do { if (tokstr
executed 82 times by 1 test: } while (0);sh_xfree((tokstr), "expr.c", 400); Executed by:
| 82-127 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
239 | do { if (expression
executed 209 times by 1 test: } while (0);sh_xfree((expression), "expr.c", 401); Executed by:
| 0-209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
240 | tokstr = expression = (char *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
241 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
242 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
244 | expr_unwind (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
245 | expr_depth = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
246 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
247 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
248 | __builtin_memcpy ((evalbuf), (oevalbuf), (sizeof (evalbuf))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
249 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
250 | if (validp
| 0-209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
251 | * executed 209 times by 1 test: validp = 0;*validp = 0; Executed by:
executed 209 times by 1 test: *validp = 0; Executed by:
| 209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
252 | return executed 209 times by 1 test: (0);return (0); Executed by:
executed 209 times by 1 test: return (0); Executed by:
| 209 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
253 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
254 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
255 | val = subexpr (expr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
256 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
257 | if (validp
| 0-7256272 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
258 | * executed 7256272 times by 1 test: validp = 1;*validp = 1; Executed by:
executed 7256272 times by 1 test: *validp = 1; Executed by:
| 7256272 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
259 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
260 | __builtin_memcpy ((evalbuf), (oevalbuf), (sizeof (evalbuf))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
262 | return executed 7256272 times by 1 test: (val);return (val); Executed by:
executed 7256272 times by 1 test: return (val); Executed by:
| 7256272 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
263 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
265 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
266 | subexpr (expr) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
267 | char *expr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
268 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
269 | intmax_t val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
270 | char *p; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
271 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
272 | for (p = expr; p
| 0-14516482 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
273 | ; executed 8346 times by 1 test: ; Executed by:
| 8346 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
274 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
275 | if (p ==
| 16-14508136 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
276 | ((void *)0)
| 16-14508136 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
277 | || *
| 27-14508109 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
278 | return executed 43 times by 1 test: (0);return (0); Executed by:
executed 43 times by 1 test: return (0); Executed by:
| 43 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
279 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
280 | pushexp (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
281 | expression = (char *)strcpy (sh_xmalloc((1 + strlen (expr)), "expr.c", 439), (expr)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
282 | tp = expression; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
284 | curtok = lasttok = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
285 | tokstr = (char *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
286 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
287 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
288 | tokval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
289 | init_lvalue (&curlval); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
290 | lastlval = curlval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
291 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
292 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
294 | val = expcomma (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
295 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
296 | if (curtok != 0
| 15-14507889 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
297 | evalerror ( executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) ); Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
298 | dcgettext (((void *)0), executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) ); Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
299 | "syntax error in expression" executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) ); Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
300 | , 5) executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) ); Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
301 | ); executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) ); Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
302 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
303 | do { if (tokstr
executed 736643 times by 1 test: } while (0);sh_xfree((tokstr), "expr.c", 455); Executed by:
| 736643-13771246 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
304 | do { if (expression
executed 14507889 times by 1 test: } while (0);sh_xfree((expression), "expr.c", 456); Executed by:
| 0-14507889 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
305 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
306 | popexp (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
307 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
308 | return executed 14507889 times by 1 test: val;return val; Executed by:
executed 14507889 times by 1 test: return val; Executed by:
| 14507889 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
309 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
311 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
312 | expcomma () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
313 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
314 | register intmax_t value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
315 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
316 | value = expassign (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
317 | while (curtok == ','
| 39613-14528747 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
318 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
319 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
320 | value = expassign (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
321 | } executed 39613 times by 1 test: end of block Executed by:
| 39613 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
323 | return executed 14528747 times by 1 test: value;return value; Executed by:
executed 14528747 times by 1 test: return value; Executed by:
| 14528747 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
324 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
325 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
326 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
327 | expassign () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
328 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
329 | register intmax_t value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
330 | char *lhs, *rhs; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
331 | arrayind_t lind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
332 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
333 | imaxdiv_t idiv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
336 | value = expcond (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
337 | if (curtok == '='
| 2636-21074228 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
338 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
339 | int special, op; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
340 | intmax_t lvalue; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
341 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
342 | special = curtok == 11; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
343 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
344 | if (lasttok != 5
| 52-6508450 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
345 | evalerror ( executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) ); Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
346 | dcgettext (((void *)0), executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) ); Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
347 | "attempted assignment to non-variable" executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) ); Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
348 | , 5) executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) ); Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
349 | ); executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) ); Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
351 | if (special
| 2592-6505858 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
352 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
353 | op = assigntok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
354 | lvalue = value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
355 | } executed 6505858 times by 1 test: end of block Executed by:
| 6505858 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
357 | if (tokstr == 0
| 0-6508450 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
358 | evalerror ( never executed: evalerror ( dcgettext (((void *)0), "syntax error in variable assignment" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
359 | dcgettext (((void *)0), never executed: evalerror ( dcgettext (((void *)0), "syntax error in variable assignment" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
360 | "syntax error in variable assignment" never executed: evalerror ( dcgettext (((void *)0), "syntax error in variable assignment" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
361 | , 5) never executed: evalerror ( dcgettext (((void *)0), "syntax error in variable assignment" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
362 | ); never executed: evalerror ( dcgettext (((void *)0), "syntax error in variable assignment" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
363 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
365 | lhs = (char *)strcpy (sh_xmalloc((1 + strlen (tokstr)), "expr.c", 509), (tokstr)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
366 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
367 | lind = curlval.ind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
368 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
369 | value = expassign (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
370 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
371 | if (special
| 2584-6505842 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
372 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
373 | if ((op == '/'
| 0-6505832 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
374 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
375 | if (noeval == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
376 | evalerror ( never executed: evalerror ( dcgettext (((void *)0), "division by 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
377 | dcgettext (((void *)0), never executed: evalerror ( dcgettext (((void *)0), "division by 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
378 | "division by 0" never executed: evalerror ( dcgettext (((void *)0), "division by 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
379 | , 5) never executed: evalerror ( dcgettext (((void *)0), "division by 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
380 | ); never executed: evalerror ( dcgettext (((void *)0), "division by 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
381 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
382 | value = 1; never executed: value = 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
383 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
385 | switch (op) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
386 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
387 | case executed 19819 times by 1 test: '*':case '*': Executed by:
executed 19819 times by 1 test: case '*': Executed by:
| 19819 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
388 | lvalue *= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
389 | break; executed 19819 times by 1 test: break; Executed by:
| 19819 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
390 | case executed 10 times by 1 test: '/':case '/': Executed by:
executed 10 times by 1 test: case '/': Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
391 | case executed 11 times by 1 test: '%':case '%': Executed by:
executed 11 times by 1 test: case '%': Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
392 | if (lvalue ==
| 4-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
393 | (-9223372036854775807L -1)
| 4-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
394 | && value == -1
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
395 | lvalue = (
executed 4 times by 1 test: lvalue = (op == '/') ? (-9223372036854775807L -1) : 0; Executed by:
| 2-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
396 | (-9223372036854775807L -1) executed 4 times by 1 test: lvalue = (op == '/') ? (-9223372036854775807L -1) : 0; Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
397 | : 0; executed 4 times by 1 test: lvalue = (op == '/') ? (-9223372036854775807L -1) : 0; Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
398 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
399 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
400 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 | idiv = imaxdiv (lvalue, value); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
402 | lvalue = (
| 8-9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
403 | } executed 17 times by 1 test: end of block Executed by:
| 17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
405 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
406 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
407 | break; executed 21 times by 1 test: break; Executed by:
| 21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
408 | case executed 6485953 times by 1 test: '+':case '+': Executed by:
executed 6485953 times by 1 test: case '+': Executed by:
| 6485953 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
409 | lvalue += value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
410 | break; executed 6485953 times by 1 test: break; Executed by:
| 6485953 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
411 | case executed 9 times by 1 test: '-':case '-': Executed by:
executed 9 times by 1 test: case '-': Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
412 | lvalue -= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
413 | break; executed 9 times by 1 test: break; Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
414 | case executed 16 times by 1 test: 9:case 9: Executed by:
executed 16 times by 1 test: case 9: Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
415 | lvalue <<= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
416 | break; executed 16 times by 1 test: break; Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
417 | case executed 8 times by 1 test: 10:case 10: Executed by:
executed 8 times by 1 test: case 10: Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
418 | lvalue >>= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
419 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
420 | case executed 8 times by 1 test: '&':case '&': Executed by:
executed 8 times by 1 test: case '&': Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
421 | lvalue &= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
422 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
423 | case executed 8 times by 1 test: '|':case '|': Executed by:
executed 8 times by 1 test: case '|': Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
424 | lvalue |= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
425 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
426 | case never executed: '^':case '^': never executed: case '^': | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
427 | lvalue ^= value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
428 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
429 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
430 | sh_xfree((lhs), "expr.c", 566); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
431 | evalerror ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
432 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
433 | "bug: bad expassign token" | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
434 | , 5) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
435 | ); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
436 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
437 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
438 | value = lvalue; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
439 | } executed 6505842 times by 1 test: end of block Executed by:
| 6505842 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
440 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
441 | rhs = itos (value); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
442 | if (noeval == 0
| 17753-6490673 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
443 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
444 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
445 | if (lind != -1
| 4-6490669 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
446 | expr_bind_array_element (lhs, lind, rhs); executed 4 times by 1 test: expr_bind_array_element (lhs, lind, rhs); Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
447 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
448 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
449 | expr_bind_variable (lhs, rhs); executed 6490669 times by 1 test: expr_bind_variable (lhs, rhs); Executed by:
| 6490669 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
450 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
451 | if (curlval.tokstr
| 0-6488134 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
452 | init_lvalue (&curlval); executed 6488134 times by 1 test: init_lvalue (&curlval); Executed by:
| 6488134 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
453 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
454 | sh_xfree((rhs), "expr.c", 586); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
455 | sh_xfree((lhs), "expr.c", 587); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
456 | do { if (tokstr
executed 6507816 times by 1 test: } while (0);sh_xfree((tokstr), "expr.c", 588); Executed by:
| 608-6507816 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
457 | tokstr = (char *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
458 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
459 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
460 | } executed 6508424 times by 1 test: end of block Executed by:
| 6508424 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
461 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
462 | return executed 21076786 times by 1 test: (value);return (value); Executed by:
executed 21076786 times by 1 test: return (value); Executed by:
| 21076786 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
463 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
464 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
465 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
466 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
467 | expcond () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
468 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
469 | intmax_t cval, val1, val2, rval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
470 | int set_noeval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
471 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
472 | set_noeval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
473 | rval = cval = explor (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
474 | if (curtok == '?'
| 240-21076864 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
475 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
476 | if (cval == 0
| 68-172 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
477 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
478 | set_noeval = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
479 | noeval++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
480 | } executed 68 times by 1 test: end of block Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
481 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
482 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
483 | if (curtok == 0
| 0-240 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
484 | evalerror ( executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
485 | dcgettext (((void *)0), executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
486 | "expression expected" executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
487 | , 5) executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
488 | ); executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
489 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
490 | val1 = expcomma (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
491 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
492 | if (set_noeval
| 68-166 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
493 | noeval--; executed 68 times by 1 test: noeval--; Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
494 | if (curtok != ':'
| 6-228 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
495 | evalerror ( executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
496 | dcgettext (((void *)0), executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
497 | "`:' expected for conditional expression" executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
498 | , 5) executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
499 | ); executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
501 | set_noeval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
502 | if (cval
| 68-160 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
503 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
504 | set_noeval = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
505 | noeval++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
506 | } executed 160 times by 1 test: end of block Executed by:
| 160 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
507 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
508 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
509 | if (curtok == 0
| 6-222 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
510 | evalerror ( executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
511 | dcgettext (((void *)0), executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
512 | "expression expected" executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
513 | , 5) executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
514 | ); executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) ); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
515 | val2 = expcond (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
516 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
517 | if (set_noeval
| 68-154 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
518 | noeval--; executed 154 times by 1 test: noeval--; Executed by:
| 154 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
519 | rval = cval
| 68-154 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
520 | lasttok = 12; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
521 | } executed 222 times by 1 test: end of block Executed by:
| 222 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
522 | return executed 21077086 times by 1 test: rval;return rval; Executed by:
executed 21077086 times by 1 test: return rval; Executed by:
| 21077086 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
523 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
524 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
525 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
526 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
527 | explor () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
528 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
529 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
530 | int set_noeval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
531 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
532 | val1 = expland (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
533 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
534 | while (curtok == 8
| 19837-21077104 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
535 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
536 | set_noeval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
537 | if (val1 != 0
| 2112-17725 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
538 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
539 | noeval++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
540 | set_noeval = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
541 | } executed 17725 times by 1 test: end of block Executed by:
| 17725 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
542 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
543 | val2 = expland (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
544 | if (set_noeval
| 2112-17725 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
545 | noeval--; executed 17725 times by 1 test: noeval--; Executed by:
| 17725 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
546 | val1 = val1
| 102-17725 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
547 | lasttok = 8; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
548 | } executed 19837 times by 1 test: end of block Executed by:
| 19837 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
550 | return executed 21077104 times by 1 test: (val1);return (val1); Executed by:
executed 21077104 times by 1 test: return (val1); Executed by:
| 21077104 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
551 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
552 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
553 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
554 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
555 | expland () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
556 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
557 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
558 | int set_noeval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
559 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
560 | val1 = expbor (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
561 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
562 | while (curtok == 7
| 65-21096941 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
563 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
564 | set_noeval = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
565 | if (val1 == 0
| 24-41 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
566 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
567 | set_noeval = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
568 | noeval++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
569 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
570 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
571 | val2 = expbor (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
572 | if (set_noeval
| 24-41 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
573 | noeval--; executed 24 times by 1 test: noeval--; Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
574 | val1 = val1
| 19-41 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
575 | lasttok = 7; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
576 | } executed 65 times by 1 test: end of block Executed by:
| 65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
577 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
578 | return executed 21096941 times by 1 test: (val1);return (val1); Executed by:
executed 21096941 times by 1 test: return (val1); Executed by:
| 21096941 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
579 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
580 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
581 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
582 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
583 | expbor () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
584 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
585 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
586 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
587 | val1 = expbxor (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
588 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
589 | while (curtok == '|'
| 33-21097006 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
590 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
591 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
592 | val2 = expbxor (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
593 | val1 = val1 | val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
594 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
595 | } executed 33 times by 1 test: end of block Executed by:
| 33 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
596 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
597 | return executed 21097006 times by 1 test: (val1);return (val1); Executed by:
executed 21097006 times by 1 test: return (val1); Executed by:
| 21097006 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
598 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
599 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
600 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
601 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
602 | expbxor () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
603 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
604 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
605 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
606 | val1 = expband (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
607 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
608 | while (curtok == '^'
| 8-21097039 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
609 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
610 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
611 | val2 = expband (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
612 | val1 = val1 ^ val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
613 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
614 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
616 | return executed 21097039 times by 1 test: (val1);return (val1); Executed by:
executed 21097039 times by 1 test: return (val1); Executed by:
| 21097039 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
617 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
618 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
619 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
620 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
621 | expband () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
622 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
623 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
624 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
625 | val1 = exp5 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
626 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
627 | while (curtok == '&'
| 26-21097047 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
628 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
629 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
630 | val2 = exp5 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
631 | val1 = val1 & val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
632 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
633 | } executed 26 times by 1 test: end of block Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
634 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
635 | return executed 21097047 times by 1 test: (val1);return (val1); Executed by:
executed 21097047 times by 1 test: return (val1); Executed by:
| 21097047 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
636 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
637 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
638 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
639 | exp5 () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
640 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
641 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
643 | val1 = exp4 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
644 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
645 | while ((
| 10-21097083 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
646 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
647 | int op = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
648 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
649 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
650 | val2 = exp4 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
651 | if (op == 1
| 10-47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
652 | val1 = (val1 == val2); executed 47 times by 1 test: val1 = (val1 == val2); Executed by:
| 47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
653 | else if (op == 2
| 0-10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
654 | val1 = (val1 != val2); executed 10 times by 1 test: val1 = (val1 != val2); Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
655 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
656 | } executed 57 times by 1 test: end of block Executed by:
| 57 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
657 | return executed 21097073 times by 1 test: (val1);return (val1); Executed by:
executed 21097073 times by 1 test: return (val1); Executed by:
| 21097073 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
658 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
659 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
660 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
661 | exp4 () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
662 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
663 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
664 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
665 | val1 = expshift (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
666 | while ((
| 19827-21117640 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
667 | (
| 1625-21116015 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
668 | (
| 16589-21099426 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
669 | (
| 2296-21097130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
670 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
671 | int op = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
672 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
673 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
674 | val2 = expshift (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
676 | if (op == 3
| 19827-20510 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
677 | val1 = val1 <= val2; executed 19827 times by 1 test: val1 = val1 <= val2; Executed by:
| 19827 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
678 | else if (op == 4
| 1625-18885 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
679 | val1 = val1 >= val2; executed 1625 times by 1 test: val1 = val1 >= val2; Executed by:
| 1625 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
680 | else if (op == '<'
| 2296-16589 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
681 | val1 = val1 < val2; executed 16589 times by 1 test: val1 = val1 < val2; Executed by:
| 16589 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
682 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
683 | val1 = val1 > val2; executed 2296 times by 1 test: val1 = val1 > val2; Executed by:
| 2296 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
684 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
685 | } executed 40337 times by 1 test: end of block Executed by:
| 40337 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
686 | return executed 21097130 times by 1 test: (val1);return (val1); Executed by:
executed 21097130 times by 1 test: return (val1); Executed by:
| 21097130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
687 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
688 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
689 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
690 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
691 | expshift () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
692 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
693 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
694 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
695 | val1 = exp3 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
697 | while ((
| 8-21137475 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
698 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
699 | int op = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
700 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
701 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
702 | val2 = exp3 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
703 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
704 | if (op == 9
| 8-9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
705 | val1 = val1 << val2; executed 9 times by 1 test: val1 = val1 << val2; Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
706 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
707 | val1 = val1 >> val2; executed 8 times by 1 test: val1 = val1 >> val2; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
708 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
709 | } executed 17 times by 1 test: end of block Executed by:
| 17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
710 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
711 | return executed 21137467 times by 1 test: (val1);return (val1); Executed by:
executed 21137467 times by 1 test: return (val1); Executed by:
| 21137467 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
712 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
713 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
714 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
715 | exp3 () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
716 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
717 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
718 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
719 | val1 = exp2 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
720 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
721 | while ((
| 245-21137729 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
722 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
723 | int op = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
724 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
725 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
726 | val2 = exp2 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
727 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
728 | if (op == '+'
| 237-30829 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
729 | val1 += val2; executed 30829 times by 1 test: val1 += val2; Executed by:
| 30829 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
730 | else if (op == '-'
| 0-237 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
731 | val1 -= val2; executed 237 times by 1 test: val1 -= val2; Executed by:
| 237 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
732 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
733 | } executed 31066 times by 1 test: end of block Executed by:
| 31066 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
734 | return executed 21137484 times by 1 test: (val1);return (val1); Executed by:
executed 21137484 times by 1 test: return (val1); Executed by:
| 21137484 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
735 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
736 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
737 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
738 | exp2 () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
739 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
740 | register intmax_t val1, val2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
741 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
742 | imaxdiv_t idiv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
743 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
744 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
745 | val1 = exppower (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
746 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
747 | while ((
| 29-21208682 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
748 | (
| 60-21208622 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
749 | (
| 40038-21168584 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
750 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
751 | int op = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
752 | char *stp, *sltp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
753 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
754 | stp = tp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
755 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
756 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
757 | val2 = exppower (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
758 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
759 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
760 | if (((
| 8-40090 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
761 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
762 | if (noeval == 0
| 0-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
763 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
764 | sltp = lasttp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
765 | lasttp = stp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
766 | while (lasttp
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
767 | lasttp++; executed 8 times by 1 test: lasttp++; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
768 | evalerror ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
769 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
770 | "division by 0" | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
771 | , 5) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
772 | ); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
773 | lasttp = sltp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
774 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
775 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
776 | val2 = 1; never executed: val2 = 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
777 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
778 | else if (op == '%'
| 2-40038 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
779 | (-9223372036854775807L -1)
| 2-40036 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
780 | && val2 == -1
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
781 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
782 | val1 = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
783 | continue; executed 2 times by 1 test: continue; Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
784 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
785 | else if (op == '/'
| 2-40065 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
786 | (-9223372036854775807L -1)
| 2-50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
787 | && val2 == -1
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
788 | val2 = 1; executed 2 times by 1 test: val2 = 1; Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
789 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
790 | if (op == '*'
| 29-40088 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
791 | val1 *= val2; executed 29 times by 1 test: val1 *= val2; Executed by:
| 29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
792 | else if (op == '/'
| 0-40036 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
793 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
794 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
795 | idiv = imaxdiv (val1, val2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
796 | val1 = (
| 52-40036 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
797 | } executed 40088 times by 1 test: end of block Executed by:
| 40088 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
798 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
799 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
800 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
801 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
802 | } executed 40117 times by 1 test: end of block Executed by:
| 40117 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
803 | return executed 21168584 times by 1 test: (val1);return (val1); Executed by:
executed 21168584 times by 1 test: return (val1); Executed by:
| 21168584 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
804 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
805 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
806 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
807 | ipow (base, exp) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
808 | intmax_t base, exp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
809 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
810 | intmax_t result; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
811 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
812 | result = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
813 | while (exp
| 27-126 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
814 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
815 | if (exp & 1
| 24-102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
816 | result *= base; executed 102 times by 1 test: result *= base; Executed by:
| 102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
817 | exp >>= 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
818 | base *= base; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
819 | } executed 126 times by 1 test: end of block Executed by:
| 126 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
820 | return executed 27 times by 1 test: result;return result; Executed by:
executed 27 times by 1 test: return result; Executed by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
821 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
822 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
823 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
824 | exppower () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
825 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
826 | register intmax_t val1, val2, c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
827 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
828 | val1 = exp1 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
829 | while (curtok == 13
| 33-21208746 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
830 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
831 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
832 | val2 = exppower (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
833 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
834 | if (val2 == 0
| 6-27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
835 | return executed 6 times by 1 test: (1);return (1); Executed by:
executed 6 times by 1 test: return (1); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
836 | if (val2 < 0
| 0-27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
837 | evalerror ( never executed: evalerror ( dcgettext (((void *)0), "exponent less than 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
838 | dcgettext (((void *)0), never executed: evalerror ( dcgettext (((void *)0), "exponent less than 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
839 | "exponent less than 0" never executed: evalerror ( dcgettext (((void *)0), "exponent less than 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
840 | , 5) never executed: evalerror ( dcgettext (((void *)0), "exponent less than 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
841 | ); never executed: evalerror ( dcgettext (((void *)0), "exponent less than 0" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
842 | val1 = ipow (val1, val2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
843 | } executed 27 times by 1 test: end of block Executed by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
844 | return executed 21208746 times by 1 test: (val1);return (val1); Executed by:
executed 21208746 times by 1 test: return (val1); Executed by:
| 21208746 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
845 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
846 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
847 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
848 | exp1 () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
849 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
850 | register intmax_t val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
851 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
852 | if (curtok == '!'
| 15-21238917 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
853 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
854 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
855 | val = !exp1 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
856 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
857 | } executed 15 times by 1 test: end of block Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
858 | else if (curtok == '~'
| 18-21238899 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
859 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
860 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
861 | val = ~exp1 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
862 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
863 | } executed 17 times by 1 test: end of block Executed by:
| 17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
864 | else if (curtok == '-'
| 30027-21208872 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
865 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
866 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
867 | val = - exp1 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
868 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
869 | } executed 30015 times by 1 test: end of block Executed by:
| 30015 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
870 | else if (curtok == '+'
| 79-21208793 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
871 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
872 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
873 | val = exp1 (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
874 | lasttok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
875 | } executed 73 times by 1 test: end of block Executed by:
| 73 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
876 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
877 | val = exp0 (); executed 21208793 times by 1 test: val = exp0 (); Executed by:
| 21208793 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
878 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
879 | return executed 21238872 times by 1 test: (val);return (val); Executed by:
executed 21238872 times by 1 test: return (val); Executed by:
| 21238872 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
880 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
881 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
882 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
883 | exp0 () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
884 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
885 | register intmax_t val = 0, v2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
886 | char *vincdec; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
887 | int stok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
888 | EXPR_CONTEXT ec; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
889 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
890 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
891 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
892 | if (curtok == 14
| 16-21208761 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
893 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
894 | stok = lasttok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
895 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
896 | if (curtok != 5
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
897 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
898 | evalerror ( never executed: evalerror ( dcgettext (((void *)0), "identifier expected after pre-increment or pre-decrement" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
899 | dcgettext (((void *)0), never executed: evalerror ( dcgettext (((void *)0), "identifier expected after pre-increment or pre-decrement" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
900 | "identifier expected after pre-increment or pre-decrement" never executed: evalerror ( dcgettext (((void *)0), "identifier expected after pre-increment or pre-decrement" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
901 | , 5) never executed: evalerror ( dcgettext (((void *)0), "identifier expected after pre-increment or pre-decrement" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
902 | ); never executed: evalerror ( dcgettext (((void *)0), "identifier expected after pre-increment or pre-decrement" , 5) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
903 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
904 | v2 = tokval + ((
| 16-32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
905 | vincdec = itos (v2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
906 | if (noeval == 0
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
907 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
909 | if (curlval.ind != -1
| 3-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
910 | expr_bind_array_element (curlval.tokstr, curlval.ind, vincdec); executed 3 times by 1 test: expr_bind_array_element (curlval.tokstr, curlval.ind, vincdec); Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
911 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
912 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
913 | expr_bind_variable (tokstr, vincdec); executed 45 times by 1 test: expr_bind_variable (tokstr, vincdec); Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
914 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
915 | sh_xfree((vincdec), "expr.c", 1017); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
916 | val = v2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
917 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
918 | curtok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
919 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
920 | } executed 48 times by 1 test: end of block Executed by:
| 48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
921 | else if (curtok == '('
| 20615-21188130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
922 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
923 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
924 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
925 | val = expcomma (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
926 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
927 | if (curtok != ')'
| 8-20601 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
928 | evalerror ( executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
929 | dcgettext (((void *)0), executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
930 | "missing `)'" executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
931 | , 5) executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
932 | ); executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
933 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
935 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
936 | } executed 20601 times by 1 test: end of block Executed by:
| 20601 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
937 | else if ((
| 26-13898301 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
938 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
939 | val = tokval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
940 | if (curtok == 5
| 7289803-13898301 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
941 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
942 | do { (&ec)->curtok = curtok; (&ec)->lasttok = lasttok; (&ec)->tp = tp; (&ec)->lasttp = lasttp; (&ec)->tokval = tokval; (&ec)->tokstr = tokstr; (&ec)->noeval = noeval; (&ec)->lval = curlval; } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
943 | tokstr = (char *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
944 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
945 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
946 | noeval = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
947 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
948 | stok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
949 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
950 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
951 | if (stok == 16
| 48332-7241471 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
952 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
953 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
954 | tokstr = ec.tokstr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
955 | noeval = ec.noeval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
956 | curlval = ec.lval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
957 | lasttok = 5; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
958 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
959 | v2 = val + ((
| 48332-661983 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
960 | vincdec = itos (v2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
961 | if (noeval == 0
| 17688-692627 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
962 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
963 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
964 | if (curlval.ind != -1
| 10003-682624 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
965 | expr_bind_array_element (curlval.tokstr, curlval.ind, vincdec); executed 10003 times by 1 test: expr_bind_array_element (curlval.tokstr, curlval.ind, vincdec); Executed by:
| 10003 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
966 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
967 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
968 | expr_bind_variable (tokstr, vincdec); executed 682624 times by 1 test: expr_bind_variable (tokstr, vincdec); Executed by:
| 682624 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
969 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
970 | sh_xfree((vincdec), "expr.c", 1066); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
971 | curtok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
972 | } executed 710314 times by 1 test: end of block Executed by:
| 710314 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
973 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
974 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
975 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
976 | if (stok == 5
| 9-6579479 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
977 | do { if (tokstr
executed 9 times by 1 test: }sh_xfree((tokstr), "expr.c", 1073); Executed by:
executed 9 times by 1 test: while (0);end of block Executed by:
| 0-9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
978 | do { curtok = (&ec)->curtok; lasttok = (&ec)->lasttok; tp = (&ec)->tp; lasttp = (&ec)->lasttp; tokval = (&ec)->tokval; tokstr = (&ec)->tokstr; noeval = (&ec)->noeval; curlval = (&ec)->lval; } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
979 | } executed 6579488 times by 1 test: end of block Executed by:
| 6579488 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
980 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
981 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
982 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
983 | } executed 21188103 times by 1 test: end of block Executed by:
| 21188103 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
984 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
985 | evalerror ( executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
986 | dcgettext (((void *)0), executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
987 | "syntax error: operand expected" executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
988 | , 5) executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
989 | ); executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
990 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
991 | return executed 21208752 times by 1 test: (val);return (val); Executed by:
executed 21208752 times by 1 test: return (val); Executed by:
| 21208752 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
992 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
993 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
994 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
995 | init_lvalue (lv) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
996 | struct lvalue *lv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
997 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
998 | lv->tokstr = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
999 | lv->tokvar = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1000 | lv->tokval = lv->ind = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1001 | } executed 21040922 times by 1 test: end of block Executed by:
| 21040922 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1002 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1003 | static struct lvalue * | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1004 | alloc_lvalue () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1005 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1006 | struct lvalue *lv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1007 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1008 | lv = sh_xmalloc((sizeof (struct lvalue)), "expr.c", 1100); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1009 | init_lvalue (lv); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1010 | return never executed: (lv);return (lv); never executed: return (lv); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1011 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1012 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1013 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1014 | free_lvalue (lv) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1015 | struct lvalue *lv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1016 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1017 | sh_xfree((lv), "expr.c", 1109); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1018 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1019 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1020 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1021 | expr_streval (tok, e, lvalue) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1022 | char *tok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1023 | int e; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1024 | struct lvalue *lvalue; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1025 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1026 | SHELL_VAR *v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1027 | char *value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1028 | intmax_t tval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1029 | int initial_depth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1030 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1031 | arrayind_t ind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1032 | int tflag, aflag; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1033 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1034 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1035 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1036 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1037 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1038 | if (noeval
| 35477-7251807 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1039 | return executed 35477 times by 1 test: (0);return (0); Executed by:
executed 35477 times by 1 test: return (0); Executed by:
| 35477 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1040 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1041 | initial_depth = expr_depth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1042 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1043 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1044 | tflag = assoc_expand_once
| 0-7251800 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1045 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1046 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1047 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1048 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1049 | aflag = (
| 7-7251800 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1050 | v = (
| 10105-7241702 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1051 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1052 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1053 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1054 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1055 | if ((v == 0
| 0-7251702 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1056 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1057 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1058 | value = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1059 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1060 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1061 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1062 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1063 | last_command_exit_value = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1064 | err_unboundvar (value); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1065 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1066 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1067 | if (e == ']'
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1068 | do { if (value
never executed: }sh_xfree((value), "expr.c", 1160); never executed: while (0);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1069 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1070 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1071 | if (no_longjmp_on_fatal_error
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1072 | siglongjmp((evalbuf), (1)); never executed: siglongjmp((evalbuf), (1)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1073 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1074 | if (interactive_shell
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1075 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1076 | expr_unwind (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1077 | top_level_cleanup (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1078 | jump_to_top_level (2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1079 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1080 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1081 | jump_to_top_level (1); never executed: jump_to_top_level (1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1082 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1083 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1084 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1085 | ind = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1086 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1087 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1088 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1089 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1090 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1091 | value = (
| 10105-7241702 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1092 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1093 | , &ind) : get_variable_value (v); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1094 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1095 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1096 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1097 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1098 | if (expr_depth < initial_depth
| 0-7251803 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1099 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1100 | if (no_longjmp_on_fatal_error
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1101 | siglongjmp((evalbuf), (1)); never executed: siglongjmp((evalbuf), (1)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1102 | return never executed: (0);return (0); never executed: return (0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1103 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1104 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1105 | tval = (value
| 0-7251666 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1107 | if (lvalue
| 0-7251797 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1108 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1109 | lvalue->tokstr = tok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1110 | lvalue->tokval = tval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1111 | lvalue->tokvar = v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1112 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1113 | lvalue->ind = ind; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1116 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1117 | } executed 7251797 times by 1 test: end of block Executed by:
| 7251797 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1118 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1119 | return executed 7251797 times by 1 test: (tval);return (tval); Executed by:
executed 7251797 times by 1 test: return (tval); Executed by:
| 7251797 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1120 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1121 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1122 | static int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1123 | _is_multiop (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1124 | int c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1125 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1126 | switch (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1127 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1128 | case never executed: 1:case 1: never executed: case 1: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1129 | case never executed: 2:case 2: never executed: case 2: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1130 | case never executed: 3:case 3: never executed: case 3: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1131 | case never executed: 4:case 4: never executed: case 4: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1132 | case never executed: 7:case 7: never executed: case 7: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1133 | case never executed: 8:case 8: never executed: case 8: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1134 | case never executed: 9:case 9: never executed: case 9: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1135 | case never executed: 10:case 10: never executed: case 10: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1136 | case executed 16 times by 1 test: 11:case 11: Executed by:
executed 16 times by 1 test: case 11: Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1137 | case never executed: 12:case 12: never executed: case 12: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1138 | case never executed: 13:case 13: never executed: case 13: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1139 | case never executed: 14:case 14: never executed: case 14: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1140 | case never executed: 15:case 15: never executed: case 15: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1141 | case never executed: 16:case 16: never executed: case 16: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1142 | case never executed: 17:case 17: never executed: case 17: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1143 | return executed 16 times by 1 test: 1;return 1; Executed by:
executed 16 times by 1 test: return 1; Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1144 | default executed 1 time by 1 test: :default: Executed by:
executed 1 time by 1 test: default: Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1145 | return executed 1 time by 1 test: 0;return 0; Executed by:
executed 1 time by 1 test: return 0; Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1146 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1147 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1148 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1149 | static int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1150 | _is_arithop (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1151 | int c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1152 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1153 | switch (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1154 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1155 | case executed 7860 times by 1 test: '=':case '=': Executed by:
executed 7860 times by 1 test: case '=': Executed by:
| 7860 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1156 | case executed 6820 times by 1 test: '>':case '>': Executed by:
executed 6820 times by 1 test: case '>': Executed by:
| 6820 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1157 | case executed 49615 times by 1 test: '<':case '<': Executed by:
executed 49615 times by 1 test: case '<': Executed by:
| 49615 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1158 | case executed 31403 times by 1 test: '+':case '+': Executed by:
executed 31403 times by 1 test: case '+': Executed by:
| 31403 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1159 | case executed 30325 times by 1 test: '-':case '-': Executed by:
executed 30325 times by 1 test: case '-': Executed by:
| 30325 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1160 | case executed 29 times by 1 test: '*':case '*': Executed by:
executed 29 times by 1 test: case '*': Executed by:
| 29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1161 | case executed 62 times by 1 test: '/':case '/': Executed by:
executed 62 times by 1 test: case '/': Executed by:
| 62 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1162 | case executed 100077 times by 1 test: '%':case '%': Executed by:
executed 100077 times by 1 test: case '%': Executed by:
| 100077 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1163 | case executed 15 times by 1 test: '!':case '!': Executed by:
executed 15 times by 1 test: case '!': Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1164 | case executed 20615 times by 1 test: '(':case '(': Executed by:
executed 20615 times by 1 test: case '(': Executed by:
| 20615 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1165 | case executed 20657 times by 1 test: ')':case ')': Executed by:
executed 20657 times by 1 test: case ')': Executed by:
| 20657 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1166 | case executed 58 times by 1 test: '&':case '&': Executed by:
executed 58 times by 1 test: case '&': Executed by:
| 58 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1167 | case executed 65 times by 1 test: '|':case '|': Executed by:
executed 65 times by 1 test: case '|': Executed by:
| 65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1168 | case executed 8 times by 1 test: '^':case '^': Executed by:
executed 8 times by 1 test: case '^': Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1169 | case executed 18 times by 1 test: '~':case '~': Executed by:
executed 18 times by 1 test: case '~': Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1170 | return executed 267627 times by 1 test: 1;return 1; Executed by:
executed 267627 times by 1 test: return 1; Executed by:
| 267627 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1171 | case executed 360 times by 1 test: '?':case '?': Executed by:
executed 360 times by 1 test: case '?': Executed by:
| 360 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1172 | case executed 238 times by 1 test: ':':case ':': Executed by:
executed 238 times by 1 test: case ':': Executed by:
| 238 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1173 | case executed 39627 times by 1 test: ',':case ',': Executed by:
executed 39627 times by 1 test: case ',': Executed by:
| 39627 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1174 | return executed 40225 times by 1 test: 1;return 1; Executed by:
executed 40225 times by 1 test: return 1; Executed by:
| 40225 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1175 | default executed 65 times by 1 test: :default: Executed by:
executed 65 times by 1 test: default: Executed by:
| 65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1176 | return executed 65 times by 1 test: 0;return 0; Executed by:
executed 65 times by 1 test: return 0; Executed by:
| 65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1177 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1178 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1179 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1180 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1181 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1184 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1185 | readtok () | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1186 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1187 | register char *cp, *xp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1188 | register unsigned char c, c1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1189 | register int e; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1190 | struct lvalue lval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1191 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1192 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1193 | cp = tp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1194 | c = e = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1195 | while (cp
| 0-57559084 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1196 | cp++; executed 531554 times by 1 test: cp++; Executed by:
| 531554 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1197 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1198 | if (c
| 14548177-42479353 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1199 | cp++; executed 42479353 times by 1 test: cp++; Executed by:
| 42479353 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1200 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1201 | if (c == '\0'
| 14548177-42479353 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1202 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1203 | lasttok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1204 | curtok = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1205 | tp = cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1206 | return; executed 14548177 times by 1 test: return; Executed by:
| 14548177 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1207 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1208 | lasttp = tp = cp - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1209 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1210 | if (((1 && | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1211 | ((*
| 7289797-35189556 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1212 | (unsigned char)c
| 7289797-35189556 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1213 | ))] & (unsigned short int) _ISalpha)
| 7289797-35189556 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1214 | ) || (
| 96-35189460 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1215 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1216 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1217 | char *savecp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1218 | EXPR_CONTEXT ec; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1219 | int peektok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1220 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1221 | while (((1 && | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1222 | ((*
| 7292253-39686936 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1223 | (unsigned char)c
| 7292253-39686936 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1224 | ))] & (unsigned short int) _ISalnum)
| 7292253-39686936 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1225 | ) || c == '_'
| 2360-7289893 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1226 | c = *cp++; executed 39689296 times by 1 test: c = *cp++; Executed by:
| 39689296 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1227 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1228 | c = *--cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1229 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1230 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1231 | if (c == '['
| 10154-7279739 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1232 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1233 | e = skipsubscript (cp, 0, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1234 | if (cp[e] == ']'
| 0-10154 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1235 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1236 | cp += e + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1237 | c = *cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1238 | e = ']'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1239 | } executed 10154 times by 1 test: end of block Executed by:
| 10154 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1240 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1241 | evalerror (bash_badsub_errmsg); never executed: evalerror (bash_badsub_errmsg); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1242 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1243 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1244 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1245 | *cp = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1246 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1247 | if (curlval.tokstr
| 9-7245205 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1248 | init_lvalue (&curlval); executed 44679 times by 1 test: init_lvalue (&curlval); Executed by:
| 44679 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1249 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1250 | do { if (tokstr
executed 45322 times by 1 test: } while (0);sh_xfree((tokstr), "expr.c", 1332); Executed by:
| 45322-7244571 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1251 | tokstr = (char *)strcpy (sh_xmalloc((1 + strlen (tp)), "expr.c", 1333), (tp)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1252 | *cp = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1253 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1254 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1255 | do { (&ec)->curtok = curtok; (&ec)->lasttok = lasttok; (&ec)->tp = tp; (&ec)->lasttp = lasttp; (&ec)->tokval = tokval; (&ec)->tokstr = tokstr; (&ec)->noeval = noeval; (&ec)->lval = curlval; } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1256 | tokstr = (char *) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1257 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1258 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1259 | tp = savecp = cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1260 | noeval = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1261 | curtok = 5; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1262 | readtok (); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1263 | peektok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1264 | if (peektok == 5
| 9-7289883 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1265 | do { if (tokstr
executed 9 times by 1 test: }sh_xfree((tokstr), "expr.c", 1345); Executed by:
executed 9 times by 1 test: while (0);end of block Executed by:
| 0-9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1266 | do { curtok = (&ec)->curtok; lasttok = (&ec)->lasttok; tp = (&ec)->tp; lasttp = (&ec)->lasttp; tokval = (&ec)->tokval; tokstr = (&ec)->tokstr; noeval = (&ec)->noeval; curlval = (&ec)->lval; } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1267 | cp = savecp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1268 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1269 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1270 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1271 | if (lasttok == 14
| 16-7289860 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1272 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1273 | lastlval = curlval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1274 | tokval = expr_streval (tokstr, e, &curlval); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1275 | } executed 7287274 times by 1 test: end of block Executed by:
| 7287274 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1276 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1277 | tokval = 0; executed 2608 times by 1 test: tokval = 0; Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1279 | lasttok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1280 | curtok = 5; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1281 | } executed 7289882 times by 1 test: end of block Executed by:
| 7289882 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1282 | else if (((
| 109805-21181316 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1283 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1284 | while ((1 && | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1285 | ((*
| 13898513-33140000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1286 | (unsigned char)c
| 13898513-33140000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1287 | ))] & (unsigned short int) _ISalnum)
| 13898513-33140000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1288 | ) || c == '#'
| 8-13898355 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1289 | c = *cp++; executed 33140174 times by 1 test: c = *cp++; Executed by:
| 33140174 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1291 | c = *--cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1292 | *cp = '\0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1294 | tokval = strlong (tp); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1295 | *cp = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1296 | lasttok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1297 | curtok = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1298 | } executed 13898307 times by 1 test: end of block Executed by:
| 13898307 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1299 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1300 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1301 | c1 = *cp++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1302 | if ((
| 95-21283166 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1303 | c = 1; executed 95 times by 1 test: c = 1; Executed by:
| 95 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1304 | else if ((
| 15-21290985 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1305 | c = 2; executed 26 times by 1 test: c = 2; Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1306 | else if ((
| 4859-21279273 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1307 | c = 4; executed 4859 times by 1 test: c = 4; Executed by:
| 4859 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1308 | else if ((
| 19881-21216586 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1309 | c = 3; executed 19881 times by 1 test: c = 3; Executed by:
| 19881 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1310 | else if ((
| 59-21216586 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1311 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1312 | if (*
| 11-48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1313 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1314 | assigntok = 9; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1315 | c = 11; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1316 | cp++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1317 | } executed 48 times by 1 test: end of block Executed by:
| 48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1318 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1319 | c = 9; executed 11 times by 1 test: c = 9; Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1320 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1321 | else if ((
| 48-21259333 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1322 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1323 | if (*
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1324 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1325 | assigntok = 10; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1326 | c = 11; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1327 | cp++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1328 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1329 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1330 | c = 10; executed 24 times by 1 test: c = 10; Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1331 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1332 | else if ((
| 82-21265946 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1333 | c = 7; executed 125 times by 1 test: c = 7; Executed by:
| 125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1334 | else if ((
| 89-21246102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1335 | c = 8; executed 19837 times by 1 test: c = 8; Executed by:
| 19837 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1336 | else if ((
| 33-21186672 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1337 | c = 13; executed 33 times by 1 test: c = 13; Executed by:
| 33 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1338 | else if ((c == '-'
| 102-19891797 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1339 | c = (
executed 1420630 times by 1 test: c = (c == '-') ? 17 : 16; Executed by:
| 96664-1420630 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1340 | else if ((c == '-'
| 0-19795133 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1341 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1342 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1343 | if (c == '-'
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1344 | evalerror ("--: assignment requires lvalue"); never executed: evalerror ("--: assignment requires lvalue"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1345 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1346 | evalerror ("++: assignment requires lvalue"); never executed: evalerror ("++: assignment requires lvalue"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1347 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1348 | else if ((c == '-'
| 102-19795133 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1349 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1352 | xp = cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1353 | while (xp
| 0-128 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1354 | xp++; executed 26 times by 1 test: xp++; Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1355 | if (((1 && | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1356 | ((*
| 48-54 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1357 | (unsigned char)(unsigned char)*xp
| 48-54 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1358 | ))] & (unsigned short int) _ISalpha)
| 48-54 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1359 | ) || ((
| 0-54 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1360 | c = (
executed 48 times by 1 test: c = (c == '-') ? 15 : 14; Executed by:
| 16-48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1361 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1362 | cp--; executed 54 times by 1 test: cp--; Executed by:
| 54 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1363 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1364 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1365 | else if (c1 == '='
| 0-19517526 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1366 | ((void *)0)
| 0-19517526 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1367 | ) : 0)
| 0-19517526 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1368 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1369 | assigntok = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1370 | c = 11; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1371 | } executed 19517526 times by 1 test: end of block Executed by:
| 19517526 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1372 | else if (_is_arithop (c) == 0
| 48-307852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1373 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1374 | cp--; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1375 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1376 | if (curtok == 0
| 0-31 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1377 | evalerror ( executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1378 | dcgettext (((void *)0), executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1379 | "syntax error: operand expected" executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1380 | , 5) executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1381 | ); executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) ); Executed by:
| 47 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1382 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1383 | evalerror ( executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) ); Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1384 | dcgettext (((void *)0), executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) ); Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1385 | "syntax error: invalid arithmetic operator" executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) ); Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1386 | , 5) executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) ); Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1387 | ); executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) ); Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1388 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1389 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1390 | cp--; executed 307852 times by 1 test: cp--; Executed by:
| 307852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1391 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1392 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1393 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1394 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1395 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1396 | lasttok = curtok; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1397 | curtok = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1398 | } executed 21291073 times by 1 test: end of block Executed by:
| 21291073 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1399 | tp = cp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1400 | } executed 42479262 times by 1 test: end of block Executed by:
| 42479262 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1402 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1403 | evalerror (msg) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1404 | const char *msg; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1405 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1406 | char *name, *t; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1407 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1408 | name = this_command_name; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1409 | for (t = expression; t
| 0-332 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1410 | ; executed 125 times by 1 test: ; Executed by:
| 125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1411 | internal_error ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1412 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1413 | "%s%s%s: %s (error token is \"%s\")" | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1414 | , 5) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1415 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1416 | name ? name : "", name ? ": " : "", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1417 | t ? t : "", msg, (lasttp && *lasttp) ? lasttp : ""); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1418 | siglongjmp((evalbuf), (1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1419 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1420 | static intmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1421 | strlong (num) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1422 | char *num; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1423 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1424 | register char *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1425 | register unsigned char c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1426 | int base, foundbase; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1427 | intmax_t val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1428 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1429 | s = num; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1430 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1431 | base = 10; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1432 | foundbase = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1433 | if (*
| 35809-13862530 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1434 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1435 | s++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1436 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1437 | if (*
| 1808-34001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1438 | return executed 34001 times by 1 test: 0;return 0; Executed by:
executed 34001 times by 1 test: return 0; Executed by:
| 34001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1439 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1440 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1441 | if (*
| 0-1792 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1442 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1443 | base = 16; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1444 | s++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1445 | } executed 1792 times by 1 test: end of block Executed by:
| 1792 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1446 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1447 | base = 8; executed 16 times by 1 test: base = 8; Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1448 | foundbase++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1449 | } executed 1808 times by 1 test: end of block Executed by:
| 1808 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1450 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1451 | val = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1452 | for (c = *s++; c
| 13864306-33102525 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1453 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1454 | if (c == '#'
| 158-33102367 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1455 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1456 | if (foundbase
| 16-142 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1457 | evalerror ( executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) ); Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1458 | dcgettext (((void *)0), executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) ); Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1459 | "invalid number" executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) ); Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1460 | , 5) executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) ); Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1461 | ); executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) ); Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1462 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1463 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1464 | if (val < 2
| 0-142 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1465 | evalerror ( executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1466 | dcgettext (((void *)0), executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1467 | "invalid arithmetic base" executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1468 | , 5) executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1469 | ); executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1470 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1471 | base = val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1472 | val = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1473 | foundbase++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1474 | } executed 134 times by 1 test: end of block Executed by:
| 134 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1475 | else if ((1 && | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1476 | ((*
| 16-33102351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1477 | (unsigned char)c
| 16-33102351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1478 | ))] & (unsigned short int) _ISalnum)
| 16-33102351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1479 | ) || (
| 0-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1480 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1481 | if (((
| 0-33102367 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1482 | c = ((c) - '0'); executed 33100977 times by 1 test: c = ((c) - '0'); Executed by:
| 33100977 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1483 | else if (c >= 'a'
| 0-1127 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1484 | c -= 'a' - 10; executed 1127 times by 1 test: c -= 'a' - 10; Executed by:
| 1127 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1485 | else if (c >= 'A'
| 8-255 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1486 | c -= 'A' - ((
executed 247 times by 1 test: c -= 'A' - ((base <= 36) ? 10 : 36); Executed by:
| 16-247 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1487 | else if (c == '@'
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1488 | c = 62; executed 8 times by 1 test: c = 62; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1489 | else if (c == '_'
| 0-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1490 | c = 63; executed 8 times by 1 test: c = 63; Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1491 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1492 | if (c >= base
| 8-33102359 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1493 | evalerror ( executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1494 | dcgettext (((void *)0), executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1495 | "value too great for base" executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1496 | , 5) executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1497 | ); executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) ); Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1498 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1499 | val = (val * base) + c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1500 | } executed 33102359 times by 1 test: end of block Executed by:
| 33102359 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1501 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1502 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1503 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1504 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1505 | return executed 13864306 times by 1 test: (val);return (val); Executed by:
executed 13864306 times by 1 test: return (val); Executed by:
| 13864306 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1506 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |