OpenCoverage

expr.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/expr.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12struct lvalue-
13{-
14 char *tokstr;-
15 intmax_t tokval;-
16 SHELL_VAR *tokvar;-
17 intmax_t ind;-
18};-
19-
20-
21typedef 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-
30static char *expression;-
31static char *tp;-
32static char *lasttp;-
33static int curtok;-
34static int lasttok;-
35static int assigntok;-
36static char *tokstr;-
37static intmax_t tokval;-
38static int noeval;-
39static sigjmp_buf evalbuf;-
40-
41-
42static int already_expanded;-
43-
44static struct lvalue curlval = {0, 0, 0, -1};-
45static struct lvalue lastlval = {0, 0, 0, -1};-
46-
47static int _is_arithop (int);-
48static void readtok (void);-
49-
50static void init_lvalue (struct lvalue *);-
51static struct lvalue *alloc_lvalue (void);-
52static void free_lvalue (struct lvalue *);-
53-
54static intmax_t expr_streval (char *, int, struct lvalue *);-
55static intmax_t strlong (char *);-
56static void evalerror (const char *);-
57-
58static void pushexp (void);-
59static void popexp (void);-
60static void expr_unwind (void);-
61static void expr_bind_variable (char *, char *);-
62-
63static void expr_bind_array_element (char *, arrayind_t, char *);-
64-
65-
66static intmax_t subexpr (char *);-
67-
68static intmax_t expcomma (void);-
69static intmax_t expassign (void);-
70static intmax_t expcond (void);-
71static intmax_t explor (void);-
72static intmax_t expland (void);-
73static intmax_t expbor (void);-
74static intmax_t expbxor (void);-
75static intmax_t expband (void);-
76static intmax_t exp5 (void);-
77static intmax_t exp4 (void);-
78static intmax_t expshift (void);-
79static intmax_t exp3 (void);-
80static intmax_t exp2 (void);-
81static intmax_t exppower (void);-
82static intmax_t exp1 (void);-
83static intmax_t exp0 (void);-
84-
85-
86static EXPR_CONTEXT **expr_stack;-
87static int expr_depth;-
88static int expr_stack_size;-
89-
90-
91extern const char * const bash_badsub_errmsg;-
92static void-
93pushexp ()-
94{-
95 EXPR_CONTEXT *context;-
96-
97 if (expr_depth >= 1024
expr_depth >= 1024Description
TRUEnever evaluated
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
)
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
expr_depth >= expr_stack_sizeDescription
TRUEevaluated 4344 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14503765 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
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:
  • Self test
14508109
117-
118-
119-
120static void-
121popexp ()-
122{-
123 EXPR_CONTEXT *context;-
124-
125 if (expr_depth <= 0
expr_depth <= 0Description
TRUEnever evaluated
FALSEevaluated 14507889 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
14507889
144-
145static void-
146expr_unwind ()-
147{-
148 while (--
--expr_depth > 0Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 209 times by 1 test
Evaluated by:
  • Self test
expr_depth > 0
--expr_depth > 0Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 209 times by 1 test
Evaluated by:
  • Self test
)
7-209
149 {-
150 if (expr_stack[expr_depth]->tokstr
expr_stack[expr_depth]->tokstrDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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:
  • Self test
7
152-
153 if (expr_stack[expr_depth]->expression
expr_stack[exp...h]->expressionDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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:
  • Self test
7
155-
156 sh_xfree((expr_stack[expr_depth]), "expr.c", 313);-
157 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test
7
158 if (expr_depth == 0
expr_depth == 0Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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:
  • Self test
209
160-
161 noeval = 0;-
162}
executed 209 times by 1 test: end of block
Executed by:
  • Self test
209
163-
164static void-
165expr_bind_variable (lhs, rhs)-
166 char *lhs, *rhs;-
167{-
168 SHELL_VAR *v;-
169 int aflags;-
170-
171-
172 aflags = (assoc_expand_once
assoc_expand_onceDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7183335 times by 1 test
Evaluated by:
  • Self test
&& already_expanded
already_expandedDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) ? 0x0080 : 0;
0-7183335
173-
174-
175-
176 v = bind_int_variable (lhs, rhs, aflags);-
177 if (v
vDescription
TRUEevaluated 7183341 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
&& (((((
((((v)->attrib... (0x0000002)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7183339 times by 1 test
Evaluated by:
  • Self test
v)->attributes) & (0x0000002)))
((((v)->attrib... (0x0000002)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7183339 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((v)->attrib... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 7183339 times by 1 test
Evaluated by:
  • Self test
v)->attributes) & (0x0004000)))
((((v)->attrib... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 7183339 times by 1 test
Evaluated by:
  • Self test
))
0-7183341
178 siglongjmp((evalbuf), (1));
executed 2 times by 1 test: siglongjmp((evalbuf), (1));
Executed by:
  • Self test
2
179 stupidly_hack_special_variables (lhs);-
180}
executed 7183345 times by 1 test: end of block
Executed by:
  • Self test
7183345
181-
182-
183-
184-
185static void-
186expr_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:
  • Self test
10010
212intmax_t-
213evalexp (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
cDescription
TRUEevaluated 209 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7256486 times by 1 test
Evaluated by:
  • Self test
)
209-7256486
237 {-
238 do { if (tokstr
tokstrDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 127 times by 1 test
Evaluated by:
  • Self test
) sh_xfree((tokstr), "expr.c", 400);
executed 82 times by 1 test: sh_xfree((tokstr), "expr.c", 400);
Executed by:
  • Self test
} while (0);
82-127
239 do { if (expression
expressionDescription
TRUEevaluated 209 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((expression), "expr.c", 401);
executed 209 times by 1 test: sh_xfree((expression), "expr.c", 401);
Executed by:
  • Self test
} while (0);
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
validpDescription
TRUEevaluated 209 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-209
251 *
executed 209 times by 1 test: *validp = 0;
Executed by:
  • Self test
validp = 0;
executed 209 times by 1 test: *validp = 0;
Executed by:
  • Self test
209
252 return
executed 209 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 209 times by 1 test: return (0);
Executed by:
  • Self test
209
253 }-
254-
255 val = subexpr (expr);-
256-
257 if (validp
validpDescription
TRUEevaluated 7256272 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-7256272
258 *
executed 7256272 times by 1 test: *validp = 1;
Executed by:
  • Self test
validp = 1;
executed 7256272 times by 1 test: *validp = 1;
Executed by:
  • Self test
7256272
259-
260 __builtin_memcpy ((evalbuf), (oevalbuf), (sizeof (evalbuf)));-
261-
262 return
executed 7256272 times by 1 test: return (val);
Executed by:
  • Self test
(val);
executed 7256272 times by 1 test: return (val);
Executed by:
  • Self test
7256272
263}-
264-
265static intmax_t-
266subexpr (expr)-
267 char *expr;-
268{-
269 intmax_t val;-
270 char *p;-
271-
272 for (p = expr; p
pDescription
TRUEevaluated 14516482 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
&& *
*pDescription
TRUEevaluated 14516455 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
p
*pDescription
TRUEevaluated 14516455 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
&& ((((*
((*p) == ' ')Description
TRUEevaluated 8346 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
p) == ' ')
((*p) == ' ')Description
TRUEevaluated 8346 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
|| ((*
((*p) == '\t')Description
TRUEnever evaluated
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
p) == '\t')
((*p) == '\t')Description
TRUEnever evaluated
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
) || ((*
((*p) == '\n')Description
TRUEnever evaluated
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
p) == '\n')
((*p) == '\n')Description
TRUEnever evaluated
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
); p++)
0-14516482
273 ;
executed 8346 times by 1 test: ;
Executed by:
  • Self test
8346
274-
275 if (p ==
p == ((void *)0)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14508136 times by 1 test
Evaluated by:
  • Self test
16-14508136
276 ((void *)0)
p == ((void *)0)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14508136 times by 1 test
Evaluated by:
  • Self test
16-14508136
277 || *
*p == '\0'Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
p == '\0'
*p == '\0'Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14508109 times by 1 test
Evaluated by:
  • Self test
)
27-14508109
278 return
executed 43 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 43 times by 1 test: return (0);
Executed by:
  • Self test
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
curtok != 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14507889 times by 1 test
Evaluated by:
  • Self test
)
15-14507889
297 evalerror (
executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) );
Executed by:
  • Self test
15
298 dcgettext (((void *)0),
executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) );
Executed by:
  • Self test
15
299 "syntax error in expression"
executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) );
Executed by:
  • Self test
15
300 , 5)
executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) );
Executed by:
  • Self test
15
301 );
executed 15 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error in expression" , 5) );
Executed by:
  • Self test
15
302-
303 do { if (tokstr
tokstrDescription
TRUEevaluated 736643 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13771246 times by 1 test
Evaluated by:
  • Self test
) sh_xfree((tokstr), "expr.c", 455);
executed 736643 times by 1 test: sh_xfree((tokstr), "expr.c", 455);
Executed by:
  • Self test
} while (0);
736643-13771246
304 do { if (expression
expressionDescription
TRUEevaluated 14507889 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((expression), "expr.c", 456);
executed 14507889 times by 1 test: sh_xfree((expression), "expr.c", 456);
Executed by:
  • Self test
} while (0);
0-14507889
305-
306 popexp ();-
307-
308 return
executed 14507889 times by 1 test: return val;
Executed by:
  • Self test
val;
executed 14507889 times by 1 test: return val;
Executed by:
  • Self test
14507889
309}-
310-
311static intmax_t-
312expcomma ()-
313{-
314 register intmax_t value;-
315-
316 value = expassign ();-
317 while (curtok == ','
curtok == ','Description
TRUEevaluated 39613 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14528747 times by 1 test
Evaluated by:
  • Self test
)
39613-14528747
318 {-
319 readtok ();-
320 value = expassign ();-
321 }
executed 39613 times by 1 test: end of block
Executed by:
  • Self test
39613
322-
323 return
executed 14528747 times by 1 test: return value;
Executed by:
  • Self test
value;
executed 14528747 times by 1 test: return value;
Executed by:
  • Self test
14528747
324}-
325-
326static intmax_t-
327expassign ()-
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 == '='
curtok == '='Description
TRUEevaluated 2636 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21074228 times by 1 test
Evaluated by:
  • Self test
|| curtok == 11
curtok == 11Description
TRUEevaluated 6505866 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14568362 times by 1 test
Evaluated by:
  • Self test
)
2636-21074228
338 {-
339 int special, op;-
340 intmax_t lvalue;-
341-
342 special = curtok == 11;-
343-
344 if (lasttok != 5
lasttok != 5Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6508450 times by 1 test
Evaluated by:
  • Self test
)
52-6508450
345 evalerror (
executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) );
Executed by:
  • Self test
52
346 dcgettext (((void *)0),
executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) );
Executed by:
  • Self test
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:
  • Self test
52
348 , 5)
executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) );
Executed by:
  • Self test
52
349 );
executed 52 times by 1 test: evalerror ( dcgettext (((void *)0), "attempted assignment to non-variable" , 5) );
Executed by:
  • Self test
52
350-
351 if (special
specialDescription
TRUEevaluated 6505858 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2592 times by 1 test
Evaluated by:
  • Self test
)
2592-6505858
352 {-
353 op = assigntok;-
354 lvalue = value;-
355 }
executed 6505858 times by 1 test: end of block
Executed by:
  • Self test
6505858
356-
357 if (tokstr == 0
tokstr == 0Description
TRUEnever evaluated
FALSEevaluated 6508450 times by 1 test
Evaluated by:
  • Self test
)
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
specialDescription
TRUEevaluated 6505842 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2584 times by 1 test
Evaluated by:
  • Self test
)
2584-6505842
372 {-
373 if ((op == '/'
op == '/'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6505832 times by 1 test
Evaluated by:
  • Self test
|| op == '%'
op == '%'Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6505821 times by 1 test
Evaluated by:
  • Self test
) && value == 0
value == 0Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test
)
0-6505832
374 {-
375 if (noeval == 0
noeval == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
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:
  • Self test
'*':
executed 19819 times by 1 test: case '*':
Executed by:
  • Self test
19819
388 lvalue *= value;-
389 break;
executed 19819 times by 1 test: break;
Executed by:
  • Self test
19819
390 case
executed 10 times by 1 test: case '/':
Executed by:
  • Self test
'/':
executed 10 times by 1 test: case '/':
Executed by:
  • Self test
10
391 case
executed 11 times by 1 test: case '%':
Executed by:
  • Self test
'%':
executed 11 times by 1 test: case '%':
Executed by:
  • Self test
11
392 if (lvalue ==
lvalue == (-92...854775807L -1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test
4-17
393 (-9223372036854775807L -1)
lvalue == (-92...854775807L -1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test
4-17
394 && value == -1
value == -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-4
395 lvalue = (
(op == '/')Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
op == '/')
(op == '/')Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
?
executed 4 times by 1 test: lvalue = (op == '/') ? (-9223372036854775807L -1) : 0;
Executed by:
  • Self test
2-4
396 (-9223372036854775807L -1)
executed 4 times by 1 test: lvalue = (op == '/') ? (-9223372036854775807L -1) : 0;
Executed by:
  • Self test
4
397 : 0;
executed 4 times by 1 test: lvalue = (op == '/') ? (-9223372036854775807L -1) : 0;
Executed by:
  • Self test
4
398 else-
399-
400 {-
401 idiv = imaxdiv (lvalue, value);-
402 lvalue = (
(op == '/')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
op == '/')
(op == '/')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
? idiv.quot : idiv.rem;
8-9
403 }
executed 17 times by 1 test: end of block
Executed by:
  • Self test
17
404-
405-
406-
407 break;
executed 21 times by 1 test: break;
Executed by:
  • Self test
21
408 case
executed 6485953 times by 1 test: case '+':
Executed by:
  • Self test
'+':
executed 6485953 times by 1 test: case '+':
Executed by:
  • Self test
6485953
409 lvalue += value;-
410 break;
executed 6485953 times by 1 test: break;
Executed by:
  • Self test
6485953
411 case
executed 9 times by 1 test: case '-':
Executed by:
  • Self test
'-':
executed 9 times by 1 test: case '-':
Executed by:
  • Self test
9
412 lvalue -= value;-
413 break;
executed 9 times by 1 test: break;
Executed by:
  • Self test
9
414 case
executed 16 times by 1 test: case 9:
Executed by:
  • Self test
9:
executed 16 times by 1 test: case 9:
Executed by:
  • Self test
16
415 lvalue <<= value;-
416 break;
executed 16 times by 1 test: break;
Executed by:
  • Self test
16
417 case
executed 8 times by 1 test: case 10:
Executed by:
  • Self test
10:
executed 8 times by 1 test: case 10:
Executed by:
  • Self test
8
418 lvalue >>= value;-
419 break;
executed 8 times by 1 test: break;
Executed by:
  • Self test
8
420 case
executed 8 times by 1 test: case '&':
Executed by:
  • Self test
'&':
executed 8 times by 1 test: case '&':
Executed by:
  • Self test
8
421 lvalue &= value;-
422 break;
executed 8 times by 1 test: break;
Executed by:
  • Self test
8
423 case
executed 8 times by 1 test: case '|':
Executed by:
  • Self test
'|':
executed 8 times by 1 test: case '|':
Executed by:
  • Self test
8
424 lvalue |= value;-
425 break;
executed 8 times by 1 test: break;
Executed by:
  • Self test
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:
  • Self test
6505842
440-
441 rhs = itos (value);-
442 if (noeval == 0
noeval == 0Description
TRUEevaluated 6490673 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17753 times by 1 test
Evaluated by:
  • Self test
)
17753-6490673
443 {-
444-
445 if (lind != -1
lind != -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6490669 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
4
447 else-
448-
449 expr_bind_variable (lhs, rhs);
executed 6490669 times by 1 test: expr_bind_variable (lhs, rhs);
Executed by:
  • Self test
6490669
450 }-
451 if (curlval.tokstr
curlval.tokstrDescription
TRUEevaluated 6488134 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20290 times by 1 test
Evaluated by:
  • Self test
&& curlval.tokstr == tokstr
curlval.tokstr == tokstrDescription
TRUEevaluated 6488134 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-6488134
452 init_lvalue (&curlval);
executed 6488134 times by 1 test: init_lvalue (&curlval);
Executed by:
  • Self test
6488134
453-
454 sh_xfree((rhs), "expr.c", 586);-
455 sh_xfree((lhs), "expr.c", 587);-
456 do { if (tokstr
tokstrDescription
TRUEevaluated 6507816 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 608 times by 1 test
Evaluated by:
  • Self test
) sh_xfree((tokstr), "expr.c", 588);
executed 6507816 times by 1 test: sh_xfree((tokstr), "expr.c", 588);
Executed by:
  • Self test
} while (0);
608-6507816
457 tokstr = (char *)-
458 ((void *)0)-
459 ;-
460 }
executed 6508424 times by 1 test: end of block
Executed by:
  • Self test
6508424
461-
462 return
executed 21076786 times by 1 test: return (value);
Executed by:
  • Self test
(value);
executed 21076786 times by 1 test: return (value);
Executed by:
  • Self test
21076786
463}-
464-
465-
466static intmax_t-
467expcond ()-
468{-
469 intmax_t cval, val1, val2, rval;-
470 int set_noeval;-
471-
472 set_noeval = 0;-
473 rval = cval = explor ();-
474 if (curtok == '?'
curtok == '?'Description
TRUEevaluated 240 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21076864 times by 1 test
Evaluated by:
  • Self test
)
240-21076864
475 {-
476 if (cval == 0
cval == 0Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 172 times by 1 test
Evaluated by:
  • Self test
)
68-172
477 {-
478 set_noeval = 1;-
479 noeval++;-
480 }
executed 68 times by 1 test: end of block
Executed by:
  • Self test
68
481-
482 readtok ();-
483 if (curtok == 0
curtok == 0Description
TRUEnever evaluated
FALSEevaluated 240 times by 1 test
Evaluated by:
  • Self test
|| curtok == ':'
curtok == ':'Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 234 times by 1 test
Evaluated by:
  • Self test
)
0-240
484 evalerror (
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
485 dcgettext (((void *)0),
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
486 "expression expected"
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
487 , 5)
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
488 );
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
489-
490 val1 = expcomma ();-
491-
492 if (set_noeval
set_noevalDescription
TRUEevaluated 68 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 166 times by 1 test
Evaluated by:
  • Self test
)
68-166
493 noeval--;
executed 68 times by 1 test: noeval--;
Executed by:
  • Self test
68
494 if (curtok != ':'
curtok != ':'Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 228 times by 1 test
Evaluated by:
  • Self test
)
6-228
495 evalerror (
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) );
Executed by:
  • Self test
6
496 dcgettext (((void *)0),
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) );
Executed by:
  • Self test
6
497 "`:' expected for conditional expression"
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) );
Executed by:
  • Self test
6
498 , 5)
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) );
Executed by:
  • Self test
6
499 );
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "`:' expected for conditional expression" , 5) );
Executed by:
  • Self test
6
500-
501 set_noeval = 0;-
502 if (cval
cvalDescription
TRUEevaluated 160 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 68 times by 1 test
Evaluated by:
  • Self test
)
68-160
503 {-
504 set_noeval = 1;-
505 noeval++;-
506 }
executed 160 times by 1 test: end of block
Executed by:
  • Self test
160
507-
508 readtok ();-
509 if (curtok == 0
curtok == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 222 times by 1 test
Evaluated by:
  • Self test
)
6-222
510 evalerror (
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
511 dcgettext (((void *)0),
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
512 "expression expected"
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
513 , 5)
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
514 );
executed 6 times by 1 test: evalerror ( dcgettext (((void *)0), "expression expected" , 5) );
Executed by:
  • Self test
6
515 val2 = expcond ();-
516-
517 if (set_noeval
set_noevalDescription
TRUEevaluated 154 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 68 times by 1 test
Evaluated by:
  • Self test
)
68-154
518 noeval--;
executed 154 times by 1 test: noeval--;
Executed by:
  • Self test
154
519 rval = cval
cvalDescription
TRUEevaluated 154 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 68 times by 1 test
Evaluated by:
  • Self test
? val1 : val2;
68-154
520 lasttok = 12;-
521 }
executed 222 times by 1 test: end of block
Executed by:
  • Self test
222
522 return
executed 21077086 times by 1 test: return rval;
Executed by:
  • Self test
rval;
executed 21077086 times by 1 test: return rval;
Executed by:
  • Self test
21077086
523}-
524-
525-
526static intmax_t-
527explor ()-
528{-
529 register intmax_t val1, val2;-
530 int set_noeval;-
531-
532 val1 = expland ();-
533-
534 while (curtok == 8
curtok == 8Description
TRUEevaluated 19837 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21077104 times by 1 test
Evaluated by:
  • Self test
)
19837-21077104
535 {-
536 set_noeval = 0;-
537 if (val1 != 0
val1 != 0Description
TRUEevaluated 17725 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2112 times by 1 test
Evaluated by:
  • Self test
)
2112-17725
538 {-
539 noeval++;-
540 set_noeval = 1;-
541 }
executed 17725 times by 1 test: end of block
Executed by:
  • Self test
17725
542 readtok ();-
543 val2 = expland ();-
544 if (set_noeval
set_noevalDescription
TRUEevaluated 17725 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2112 times by 1 test
Evaluated by:
  • Self test
)
2112-17725
545 noeval--;
executed 17725 times by 1 test: noeval--;
Executed by:
  • Self test
17725
546 val1 = val1
val1Description
TRUEevaluated 17725 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2112 times by 1 test
Evaluated by:
  • Self test
|| val2
val2Description
TRUEevaluated 2010 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 102 times by 1 test
Evaluated by:
  • Self test
;
102-17725
547 lasttok = 8;-
548 }
executed 19837 times by 1 test: end of block
Executed by:
  • Self test
19837
549-
550 return
executed 21077104 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21077104 times by 1 test: return (val1);
Executed by:
  • Self test
21077104
551}-
552-
553-
554static intmax_t-
555expland ()-
556{-
557 register intmax_t val1, val2;-
558 int set_noeval;-
559-
560 val1 = expbor ();-
561-
562 while (curtok == 7
curtok == 7Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21096941 times by 1 test
Evaluated by:
  • Self test
)
65-21096941
563 {-
564 set_noeval = 0;-
565 if (val1 == 0
val1 == 0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test
)
24-41
566 {-
567 set_noeval = 1;-
568 noeval++;-
569 }
executed 24 times by 1 test: end of block
Executed by:
  • Self test
24
570 readtok ();-
571 val2 = expbor ();-
572 if (set_noeval
set_noevalDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test
)
24-41
573 noeval--;
executed 24 times by 1 test: noeval--;
Executed by:
  • Self test
24
574 val1 = val1
val1Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 24 times by 1 test
Evaluated by:
  • Self test
&& val2
val2Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test
;
19-41
575 lasttok = 7;-
576 }
executed 65 times by 1 test: end of block
Executed by:
  • Self test
65
577-
578 return
executed 21096941 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21096941 times by 1 test: return (val1);
Executed by:
  • Self test
21096941
579}-
580-
581-
582static intmax_t-
583expbor ()-
584{-
585 register intmax_t val1, val2;-
586-
587 val1 = expbxor ();-
588-
589 while (curtok == '|'
curtok == '|'Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097006 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
33
596-
597 return
executed 21097006 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21097006 times by 1 test: return (val1);
Executed by:
  • Self test
21097006
598}-
599-
600-
601static intmax_t-
602expbxor ()-
603{-
604 register intmax_t val1, val2;-
605-
606 val1 = expband ();-
607-
608 while (curtok == '^'
curtok == '^'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097039 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
8
615-
616 return
executed 21097039 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21097039 times by 1 test: return (val1);
Executed by:
  • Self test
21097039
617}-
618-
619-
620static intmax_t-
621expband ()-
622{-
623 register intmax_t val1, val2;-
624-
625 val1 = exp5 ();-
626-
627 while (curtok == '&'
curtok == '&'Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097047 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
26
634-
635 return
executed 21097047 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21097047 times by 1 test: return (val1);
Executed by:
  • Self test
21097047
636}-
637-
638static intmax_t-
639exp5 ()-
640{-
641 register intmax_t val1, val2;-
642-
643 val1 = exp4 ();-
644-
645 while ((
(curtok == 1)Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097083 times by 1 test
Evaluated by:
  • Self test
curtok == 1)
(curtok == 1)Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097083 times by 1 test
Evaluated by:
  • Self test
|| (
(curtok == 2)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097073 times by 1 test
Evaluated by:
  • Self test
curtok == 2)
(curtok == 2)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097073 times by 1 test
Evaluated by:
  • Self test
)
10-21097083
646 {-
647 int op = curtok;-
648-
649 readtok ();-
650 val2 = exp4 ();-
651 if (op == 1
op == 1Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test
)
10-47
652 val1 = (val1 == val2);
executed 47 times by 1 test: val1 = (val1 == val2);
Executed by:
  • Self test
47
653 else if (op == 2
op == 2Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-10
654 val1 = (val1 != val2);
executed 10 times by 1 test: val1 = (val1 != val2);
Executed by:
  • Self test
10
655 lasttok = 6;-
656 }
executed 57 times by 1 test: end of block
Executed by:
  • Self test
57
657 return
executed 21097073 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21097073 times by 1 test: return (val1);
Executed by:
  • Self test
21097073
658}-
659-
660static intmax_t-
661exp4 ()-
662{-
663 register intmax_t val1, val2;-
664-
665 val1 = expshift ();-
666 while ((
(curtok == 3)Description
TRUEevaluated 19827 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21117640 times by 1 test
Evaluated by:
  • Self test
curtok == 3)
(curtok == 3)Description
TRUEevaluated 19827 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21117640 times by 1 test
Evaluated by:
  • Self test
||
19827-21117640
667 (
(curtok == 4)Description
TRUEevaluated 1625 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21116015 times by 1 test
Evaluated by:
  • Self test
curtok == 4)
(curtok == 4)Description
TRUEevaluated 1625 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21116015 times by 1 test
Evaluated by:
  • Self test
||
1625-21116015
668 (
(curtok == '<')Description
TRUEevaluated 16589 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21099426 times by 1 test
Evaluated by:
  • Self test
curtok == '<')
(curtok == '<')Description
TRUEevaluated 16589 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21099426 times by 1 test
Evaluated by:
  • Self test
||
16589-21099426
669 (
(curtok == '>')Description
TRUEevaluated 2296 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097130 times by 1 test
Evaluated by:
  • Self test
curtok == '>')
(curtok == '>')Description
TRUEevaluated 2296 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21097130 times by 1 test
Evaluated by:
  • Self test
)
2296-21097130
670 {-
671 int op = curtok;-
672-
673 readtok ();-
674 val2 = expshift ();-
675-
676 if (op == 3
op == 3Description
TRUEevaluated 19827 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20510 times by 1 test
Evaluated by:
  • Self test
)
19827-20510
677 val1 = val1 <= val2;
executed 19827 times by 1 test: val1 = val1 <= val2;
Executed by:
  • Self test
19827
678 else if (op == 4
op == 4Description
TRUEevaluated 1625 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18885 times by 1 test
Evaluated by:
  • Self test
)
1625-18885
679 val1 = val1 >= val2;
executed 1625 times by 1 test: val1 = val1 >= val2;
Executed by:
  • Self test
1625
680 else if (op == '<'
op == '<'Description
TRUEevaluated 16589 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2296 times by 1 test
Evaluated by:
  • Self test
)
2296-16589
681 val1 = val1 < val2;
executed 16589 times by 1 test: val1 = val1 < val2;
Executed by:
  • Self test
16589
682 else-
683 val1 = val1 > val2;
executed 2296 times by 1 test: val1 = val1 > val2;
Executed by:
  • Self test
2296
684 lasttok = 6;-
685 }
executed 40337 times by 1 test: end of block
Executed by:
  • Self test
40337
686 return
executed 21097130 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21097130 times by 1 test: return (val1);
Executed by:
  • Self test
21097130
687}-
688-
689-
690static intmax_t-
691expshift ()-
692{-
693 register intmax_t val1, val2;-
694-
695 val1 = exp3 ();-
696-
697 while ((
(curtok == 9)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137475 times by 1 test
Evaluated by:
  • Self test
curtok == 9)
(curtok == 9)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137475 times by 1 test
Evaluated by:
  • Self test
|| (
(curtok == 10)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137467 times by 1 test
Evaluated by:
  • Self test
curtok == 10)
(curtok == 10)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137467 times by 1 test
Evaluated by:
  • Self test
)
8-21137475
698 {-
699 int op = curtok;-
700-
701 readtok ();-
702 val2 = exp3 ();-
703-
704 if (op == 9
op == 9Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
8-9
705 val1 = val1 << val2;
executed 9 times by 1 test: val1 = val1 << val2;
Executed by:
  • Self test
9
706 else-
707 val1 = val1 >> val2;
executed 8 times by 1 test: val1 = val1 >> val2;
Executed by:
  • Self test
8
708 lasttok = 6;-
709 }
executed 17 times by 1 test: end of block
Executed by:
  • Self test
17
710-
711 return
executed 21137467 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21137467 times by 1 test: return (val1);
Executed by:
  • Self test
21137467
712}-
713-
714static intmax_t-
715exp3 ()-
716{-
717 register intmax_t val1, val2;-
718-
719 val1 = exp2 ();-
720-
721 while ((
(curtok == '+')Description
TRUEevaluated 30855 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137729 times by 1 test
Evaluated by:
  • Self test
curtok == '+')
(curtok == '+')Description
TRUEevaluated 30855 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137729 times by 1 test
Evaluated by:
  • Self test
|| (
(curtok == '-')Description
TRUEevaluated 245 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137484 times by 1 test
Evaluated by:
  • Self test
curtok == '-')
(curtok == '-')Description
TRUEevaluated 245 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21137484 times by 1 test
Evaluated by:
  • Self test
)
245-21137729
722 {-
723 int op = curtok;-
724-
725 readtok ();-
726 val2 = exp2 ();-
727-
728 if (op == '+'
op == '+'Description
TRUEevaluated 30829 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 237 times by 1 test
Evaluated by:
  • Self test
)
237-30829
729 val1 += val2;
executed 30829 times by 1 test: val1 += val2;
Executed by:
  • Self test
30829
730 else if (op == '-'
op == '-'Description
TRUEevaluated 237 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-237
731 val1 -= val2;
executed 237 times by 1 test: val1 -= val2;
Executed by:
  • Self test
237
732 lasttok = 6;-
733 }
executed 31066 times by 1 test: end of block
Executed by:
  • Self test
31066
734 return
executed 21137484 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21137484 times by 1 test: return (val1);
Executed by:
  • Self test
21137484
735}-
736-
737static intmax_t-
738exp2 ()-
739{-
740 register intmax_t val1, val2;-
741-
742 imaxdiv_t idiv;-
743-
744-
745 val1 = exppower ();-
746-
747 while ((
(curtok == '*')Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208682 times by 1 test
Evaluated by:
  • Self test
curtok == '*')
(curtok == '*')Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208682 times by 1 test
Evaluated by:
  • Self test
||
29-21208682
748 (
(curtok == '/')Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208622 times by 1 test
Evaluated by:
  • Self test
curtok == '/')
(curtok == '/')Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208622 times by 1 test
Evaluated by:
  • Self test
||
60-21208622
749 (
(curtok == '%')Description
TRUEevaluated 40038 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21168584 times by 1 test
Evaluated by:
  • Self test
curtok == '%')
(curtok == '%')Description
TRUEevaluated 40038 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21168584 times by 1 test
Evaluated by:
  • Self test
)
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 (((
(op == '/')Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40067 times by 1 test
Evaluated by:
  • Self test
op == '/')
(op == '/')Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40067 times by 1 test
Evaluated by:
  • Self test
|| (
(op == '%')Description
TRUEevaluated 40038 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 29 times by 1 test
Evaluated by:
  • Self test
op == '%')
(op == '%')Description
TRUEevaluated 40038 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 29 times by 1 test
Evaluated by:
  • Self test
) && (
(val2 == 0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40090 times by 1 test
Evaluated by:
  • Self test
val2 == 0)
(val2 == 0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40090 times by 1 test
Evaluated by:
  • Self test
)
8-40090
761 {-
762 if (noeval == 0
noeval == 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-8
763 {-
764 sltp = lasttp;-
765 lasttp = stp;-
766 while (lasttp
lasttpDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& *
*lasttpDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
lasttp
*lasttpDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (((*
((*lasttp) == ' ')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
lasttp) == ' ')
((*lasttp) == ' ')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
|| ((*
((*lasttp) == '\t')Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
lasttp) == '\t')
((*lasttp) == '\t')Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
))
0-16
767 lasttp++;
executed 8 times by 1 test: lasttp++;
Executed by:
  • Self test
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 == '%'
op == '%'Description
TRUEevaluated 40038 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 81 times by 1 test
Evaluated by:
  • Self test
&& val1 ==
val1 == (-9223...854775807L -1)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40036 times by 1 test
Evaluated by:
  • Self test
2-40038
779 (-9223372036854775807L -1)
val1 == (-9223...854775807L -1)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40036 times by 1 test
Evaluated by:
  • Self test
2-40036
780 && val2 == -1
val2 == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2
781 {-
782 val1 = 0;-
783 continue;
executed 2 times by 1 test: continue;
Executed by:
  • Self test
2
784 }-
785 else if (op == '/'
op == '/'Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40065 times by 1 test
Evaluated by:
  • Self test
&& val1 ==
val1 == (-9223...854775807L -1)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 50 times by 1 test
Evaluated by:
  • Self test
2-40065
786 (-9223372036854775807L -1)
val1 == (-9223...854775807L -1)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 50 times by 1 test
Evaluated by:
  • Self test
2-50
787 && val2 == -1
val2 == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2
788 val2 = 1;
executed 2 times by 1 test: val2 = 1;
Executed by:
  • Self test
2
789-
790 if (op == '*'
op == '*'Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40088 times by 1 test
Evaluated by:
  • Self test
)
29-40088
791 val1 *= val2;
executed 29 times by 1 test: val1 *= val2;
Executed by:
  • Self test
29
792 else if (op == '/'
op == '/'Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40036 times by 1 test
Evaluated by:
  • Self test
|| op == '%'
op == '%'Description
TRUEevaluated 40036 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-40036
793-
794 {-
795 idiv = imaxdiv (val1, val2);-
796 val1 = (
(op == '/')Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40036 times by 1 test
Evaluated by:
  • Self test
op == '/')
(op == '/')Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 40036 times by 1 test
Evaluated by:
  • Self test
? idiv.quot : idiv.rem;
52-40036
797 }
executed 40088 times by 1 test: end of block
Executed by:
  • Self test
40088
798-
799-
800-
801 lasttok = 6;-
802 }
executed 40117 times by 1 test: end of block
Executed by:
  • Self test
40117
803 return
executed 21168584 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21168584 times by 1 test: return (val1);
Executed by:
  • Self test
21168584
804}-
805-
806static intmax_t-
807ipow (base, exp)-
808 intmax_t base, exp;-
809{-
810 intmax_t result;-
811-
812 result = 1;-
813 while (exp
expDescription
TRUEevaluated 126 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
)
27-126
814 {-
815 if (exp & 1
exp & 1Description
TRUEevaluated 102 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 24 times by 1 test
Evaluated by:
  • Self test
)
24-102
816 result *= base;
executed 102 times by 1 test: result *= base;
Executed by:
  • Self test
102
817 exp >>= 1;-
818 base *= base;-
819 }
executed 126 times by 1 test: end of block
Executed by:
  • Self test
126
820 return
executed 27 times by 1 test: return result;
Executed by:
  • Self test
result;
executed 27 times by 1 test: return result;
Executed by:
  • Self test
27
821}-
822-
823static intmax_t-
824exppower ()-
825{-
826 register intmax_t val1, val2, c;-
827-
828 val1 = exp1 ();-
829 while (curtok == 13
curtok == 13Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208746 times by 1 test
Evaluated by:
  • Self test
)
33-21208746
830 {-
831 readtok ();-
832 val2 = exppower ();-
833 lasttok = 6;-
834 if (val2 == 0
val2 == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
)
6-27
835 return
executed 6 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 6 times by 1 test: return (1);
Executed by:
  • Self test
6
836 if (val2 < 0
val2 < 0Description
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
27
844 return
executed 21208746 times by 1 test: return (val1);
Executed by:
  • Self test
(val1);
executed 21208746 times by 1 test: return (val1);
Executed by:
  • Self test
21208746
845}-
846-
847static intmax_t-
848exp1 ()-
849{-
850 register intmax_t val;-
851-
852 if (curtok == '!'
curtok == '!'Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21238917 times by 1 test
Evaluated by:
  • Self test
)
15-21238917
853 {-
854 readtok ();-
855 val = !exp1 ();-
856 lasttok = 6;-
857 }
executed 15 times by 1 test: end of block
Executed by:
  • Self test
15
858 else if (curtok == '~'
curtok == '~'Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21238899 times by 1 test
Evaluated by:
  • Self test
)
18-21238899
859 {-
860 readtok ();-
861 val = ~exp1 ();-
862 lasttok = 6;-
863 }
executed 17 times by 1 test: end of block
Executed by:
  • Self test
17
864 else if (curtok == '-'
curtok == '-'Description
TRUEevaluated 30027 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208872 times by 1 test
Evaluated by:
  • Self test
)
30027-21208872
865 {-
866 readtok ();-
867 val = - exp1 ();-
868 lasttok = 6;-
869 }
executed 30015 times by 1 test: end of block
Executed by:
  • Self test
30015
870 else if (curtok == '+'
curtok == '+'Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208793 times by 1 test
Evaluated by:
  • Self test
)
79-21208793
871 {-
872 readtok ();-
873 val = exp1 ();-
874 lasttok = 6;-
875 }
executed 73 times by 1 test: end of block
Executed by:
  • Self test
73
876 else-
877 val = exp0 ();
executed 21208793 times by 1 test: val = exp0 ();
Executed by:
  • Self test
21208793
878-
879 return
executed 21238872 times by 1 test: return (val);
Executed by:
  • Self test
(val);
executed 21238872 times by 1 test: return (val);
Executed by:
  • Self test
21238872
880}-
881-
882static intmax_t-
883exp0 ()-
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
curtok == 14Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208761 times by 1 test
Evaluated by:
  • Self test
|| curtok == 15
curtok == 15Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21208745 times by 1 test
Evaluated by:
  • Self test
)
16-21208761
893 {-
894 stok = lasttok = curtok;-
895 readtok ();-
896 if (curtok != 5
curtok != 5Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • Self test
)
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 + ((
(stok == 14)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
stok == 14)
(stok == 14)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
? 1 : -1);
16-32
905 vincdec = itos (v2);-
906 if (noeval == 0
noeval == 0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-48
907 {-
908-
909 if (curlval.ind != -1
curlval.ind != -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
3
911 else-
912-
913 expr_bind_variable (tokstr, vincdec);
executed 45 times by 1 test: expr_bind_variable (tokstr, vincdec);
Executed by:
  • Self test
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:
  • Self test
48
921 else if (curtok == '('
curtok == '('Description
TRUEevaluated 20615 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21188130 times by 1 test
Evaluated by:
  • Self test
)
20615-21188130
922 {-
923-
924 readtok ();-
925 val = expcomma ();-
926-
927 if (curtok != ')'
curtok != ')'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20601 times by 1 test
Evaluated by:
  • Self test
)
8-20601
928 evalerror (
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) );
Executed by:
  • Self test
8
929 dcgettext (((void *)0),
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) );
Executed by:
  • Self test
8
930 "missing `)'"
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) );
Executed by:
  • Self test
8
931 , 5)
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) );
Executed by:
  • Self test
8
932 );
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "missing `)'" , 5) );
Executed by:
  • Self test
8
933-
934-
935 readtok ();-
936 }
executed 20601 times by 1 test: end of block
Executed by:
  • Self test
20601
937 else if ((
(curtok == 6)Description
TRUEevaluated 13898301 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7289829 times by 1 test
Evaluated by:
  • Self test
curtok == 6)
(curtok == 6)Description
TRUEevaluated 13898301 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7289829 times by 1 test
Evaluated by:
  • Self test
|| (
(curtok == 5)Description
TRUEevaluated 7289803 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test
curtok == 5)
(curtok == 5)Description
TRUEevaluated 7289803 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test
)
26-13898301
938 {-
939 val = tokval;-
940 if (curtok == 5
curtok == 5Description
TRUEevaluated 7289803 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898301 times by 1 test
Evaluated by:
  • Self test
)
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
stok == 16Description
TRUEevaluated 48332 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7241471 times by 1 test
Evaluated by:
  • Self test
|| stok == 17
stok == 17Description
TRUEevaluated 661983 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6579488 times by 1 test
Evaluated by:
  • Self test
)
48332-7241471
952 {-
953-
954 tokstr = ec.tokstr;-
955 noeval = ec.noeval;-
956 curlval = ec.lval;-
957 lasttok = 5;-
958-
959 v2 = val + ((
(stok == 16)Description
TRUEevaluated 48332 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 661983 times by 1 test
Evaluated by:
  • Self test
stok == 16)
(stok == 16)Description
TRUEevaluated 48332 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 661983 times by 1 test
Evaluated by:
  • Self test
? 1 : -1);
48332-661983
960 vincdec = itos (v2);-
961 if (noeval == 0
noeval == 0Description
TRUEevaluated 692627 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17688 times by 1 test
Evaluated by:
  • Self test
)
17688-692627
962 {-
963-
964 if (curlval.ind != -1
curlval.ind != -1Description
TRUEevaluated 10003 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 682624 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
10003
966 else-
967-
968 expr_bind_variable (tokstr, vincdec);
executed 682624 times by 1 test: expr_bind_variable (tokstr, vincdec);
Executed by:
  • Self test
682624
969 }-
970 sh_xfree((vincdec), "expr.c", 1066);-
971 curtok = 6;-
972 }
executed 710314 times by 1 test: end of block
Executed by:
  • Self test
710314
973 else-
974 {-
975-
976 if (stok == 5
stok == 5Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6579479 times by 1 test
Evaluated by:
  • Self test
)
9-6579479
977 do { if (tokstr
tokstrDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((tokstr), "expr.c", 1073);
executed 9 times by 1 test: sh_xfree((tokstr), "expr.c", 1073);
Executed by:
  • Self test
}
executed 9 times by 1 test: end of block
Executed by:
  • Self test
while (0);
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:
  • Self test
6579488
980 }-
981-
982 readtok ();-
983 }
executed 21188103 times by 1 test: end of block
Executed by:
  • Self test
21188103
984 else-
985 evalerror (
executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
26
986 dcgettext (((void *)0),
executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
26
987 "syntax error: operand expected"
executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
26
988 , 5)
executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
26
989 );
executed 26 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
26
990-
991 return
executed 21208752 times by 1 test: return (val);
Executed by:
  • Self test
(val);
executed 21208752 times by 1 test: return (val);
Executed by:
  • Self test
21208752
992}-
993-
994static void-
995init_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:
  • Self test
21040922
1002-
1003static struct lvalue *-
1004alloc_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: return (lv);
(lv);
never executed: return (lv);
0
1011}-
1012-
1013static void-
1014free_lvalue (lv)-
1015 struct lvalue *lv;-
1016{-
1017 sh_xfree((lv), "expr.c", 1109);-
1018}
never executed: end of block
0
1019-
1020static intmax_t-
1021expr_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
noevalDescription
TRUEevaluated 35477 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251807 times by 1 test
Evaluated by:
  • Self test
)
35477-7251807
1039 return
executed 35477 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 35477 times by 1 test: return (0);
Executed by:
  • Self test
35477
1040-
1041 initial_depth = expr_depth;-
1042-
1043-
1044 tflag = assoc_expand_once
assoc_expand_onceDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251800 times by 1 test
Evaluated by:
  • Self test
&& already_expanded
already_expandedDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
;
0-7251800
1045-
1046-
1047-
1048-
1049 aflag = (
(tflag)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251800 times by 1 test
Evaluated by:
  • Self test
tflag)
(tflag)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251800 times by 1 test
Evaluated by:
  • Self test
? 0x020 : 0;
7-7251800
1050 v = (
(e == ']')Description
TRUEevaluated 10105 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7241702 times by 1 test
Evaluated by:
  • Self test
e == ']')
(e == ']')Description
TRUEevaluated 10105 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7241702 times by 1 test
Evaluated by:
  • Self test
? array_variable_part (tok, tflag, (char **)0, (int *)0) : find_variable (tok);
10105-7241702
1051-
1052-
1053-
1054-
1055 if ((v == 0
v == 0Description
TRUEevaluated 105 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251702 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((v)->attrib... (0x0001000)))Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251692 times by 1 test
Evaluated by:
  • Self test
v)->attributes) & (0x0001000)))
((((v)->attrib... (0x0001000)))Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7251692 times by 1 test
Evaluated by:
  • Self test
) && unbound_vars_is_error
unbound_vars_is_errorDescription
TRUEnever evaluated
FALSEevaluated 115 times by 1 test
Evaluated by:
  • Self test
)
0-7251702
1056 {-
1057-
1058 value = (
(e == ']')Description
TRUEnever evaluated
FALSEnever evaluated
e == ']')
(e == ']')Description
TRUEnever evaluated
FALSEnever evaluated
? array_variable_name (tok, tflag, (char **)0, (int *)0) : tok;
0
1059-
1060-
1061-
1062-
1063 last_command_exit_value = 1;-
1064 err_unboundvar (value);-
1065-
1066-
1067 if (e == ']'
e == ']'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1068 do { if (value
valueDescription
TRUEnever evaluated
FALSEnever evaluated
) sh_xfree((value), "expr.c", 1160);
never executed: sh_xfree((value), "expr.c", 1160);
}
never executed: end of block
while (0);
0
1069-
1070-
1071 if (no_longjmp_on_fatal_error
no_longjmp_on_fatal_errorDescription
TRUEnever evaluated
FALSEnever evaluated
&& interactive_shell
interactive_shellDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1072 siglongjmp((evalbuf), (1));
never executed: siglongjmp((evalbuf), (1));
0
1073-
1074 if (interactive_shell
interactive_shellDescription
TRUEnever evaluated
FALSEnever evaluated
)
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 = (
(e == ']')Description
TRUEevaluated 10105 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7241702 times by 1 test
Evaluated by:
  • Self test
e == ']')
(e == ']')Description
TRUEevaluated 10105 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7241702 times by 1 test
Evaluated by:
  • Self test
? get_array_value (tok, aflag, (int *)
10105-7241702
1092 ((void *)0)-
1093 , &ind) : get_variable_value (v);-
1094-
1095-
1096-
1097-
1098 if (expr_depth < initial_depth
expr_depth < initial_depthDescription
TRUEnever evaluated
FALSEevaluated 7251803 times by 1 test
Evaluated by:
  • Self test
)
0-7251803
1099 {-
1100 if (no_longjmp_on_fatal_error
no_longjmp_on_fatal_errorDescription
TRUEnever evaluated
FALSEnever evaluated
&& interactive_shell
interactive_shellDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1101 siglongjmp((evalbuf), (1));
never executed: siglongjmp((evalbuf), (1));
0
1102 return
never executed: return (0);
(0);
never executed: return (0);
0
1103 }-
1104-
1105 tval = (value
valueDescription
TRUEevaluated 7251666 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 137 times by 1 test
Evaluated by:
  • Self test
&& *
*valueDescription
TRUEevaluated 7251666 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
value
*valueDescription
TRUEevaluated 7251666 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) ? subexpr (value) : 0;
0-7251666
1106-
1107 if (lvalue
lvalueDescription
TRUEevaluated 7251797 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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:
  • Self test
7251797
1118-
1119 return
executed 7251797 times by 1 test: return (tval);
Executed by:
  • Self test
(tval);
executed 7251797 times by 1 test: return (tval);
Executed by:
  • Self test
7251797
1120}-
1121-
1122static int-
1123_is_multiop (c)-
1124 int c;-
1125{-
1126 switch (c)-
1127 {-
1128 case
never executed: case 1:
1:
never executed: case 1:
0
1129 case
never executed: case 2:
2:
never executed: case 2:
0
1130 case
never executed: case 3:
3:
never executed: case 3:
0
1131 case
never executed: case 4:
4:
never executed: case 4:
0
1132 case
never executed: case 7:
7:
never executed: case 7:
0
1133 case
never executed: case 8:
8:
never executed: case 8:
0
1134 case
never executed: case 9:
9:
never executed: case 9:
0
1135 case
never executed: case 10:
10:
never executed: case 10:
0
1136 case
executed 16 times by 1 test: case 11:
Executed by:
  • Self test
11:
executed 16 times by 1 test: case 11:
Executed by:
  • Self test
16
1137 case
never executed: case 12:
12:
never executed: case 12:
0
1138 case
never executed: case 13:
13:
never executed: case 13:
0
1139 case
never executed: case 14:
14:
never executed: case 14:
0
1140 case
never executed: case 15:
15:
never executed: case 15:
0
1141 case
never executed: case 16:
16:
never executed: case 16:
0
1142 case
never executed: case 17:
17:
never executed: case 17:
0
1143 return
executed 16 times by 1 test: return 1;
Executed by:
  • Self test
1;
executed 16 times by 1 test: return 1;
Executed by:
  • Self test
16
1144 default
executed 1 time by 1 test: default:
Executed by:
  • Self test
:
executed 1 time by 1 test: default:
Executed by:
  • Self test
1
1145 return
executed 1 time by 1 test: return 0;
Executed by:
  • Self test
0;
executed 1 time by 1 test: return 0;
Executed by:
  • Self test
1
1146 }-
1147}-
1148-
1149static int-
1150_is_arithop (c)-
1151 int c;-
1152{-
1153 switch (c)-
1154 {-
1155 case
executed 7860 times by 1 test: case '=':
Executed by:
  • Self test
'=':
executed 7860 times by 1 test: case '=':
Executed by:
  • Self test
7860
1156 case
executed 6820 times by 1 test: case '>':
Executed by:
  • Self test
'>':
executed 6820 times by 1 test: case '>':
Executed by:
  • Self test
6820
1157 case
executed 49615 times by 1 test: case '<':
Executed by:
  • Self test
'<':
executed 49615 times by 1 test: case '<':
Executed by:
  • Self test
49615
1158 case
executed 31403 times by 1 test: case '+':
Executed by:
  • Self test
'+':
executed 31403 times by 1 test: case '+':
Executed by:
  • Self test
31403
1159 case
executed 30325 times by 1 test: case '-':
Executed by:
  • Self test
'-':
executed 30325 times by 1 test: case '-':
Executed by:
  • Self test
30325
1160 case
executed 29 times by 1 test: case '*':
Executed by:
  • Self test
'*':
executed 29 times by 1 test: case '*':
Executed by:
  • Self test
29
1161 case
executed 62 times by 1 test: case '/':
Executed by:
  • Self test
'/':
executed 62 times by 1 test: case '/':
Executed by:
  • Self test
62
1162 case
executed 100077 times by 1 test: case '%':
Executed by:
  • Self test
'%':
executed 100077 times by 1 test: case '%':
Executed by:
  • Self test
100077
1163 case
executed 15 times by 1 test: case '!':
Executed by:
  • Self test
'!':
executed 15 times by 1 test: case '!':
Executed by:
  • Self test
15
1164 case
executed 20615 times by 1 test: case '(':
Executed by:
  • Self test
'(':
executed 20615 times by 1 test: case '(':
Executed by:
  • Self test
20615
1165 case
executed 20657 times by 1 test: case ')':
Executed by:
  • Self test
')':
executed 20657 times by 1 test: case ')':
Executed by:
  • Self test
20657
1166 case
executed 58 times by 1 test: case '&':
Executed by:
  • Self test
'&':
executed 58 times by 1 test: case '&':
Executed by:
  • Self test
58
1167 case
executed 65 times by 1 test: case '|':
Executed by:
  • Self test
'|':
executed 65 times by 1 test: case '|':
Executed by:
  • Self test
65
1168 case
executed 8 times by 1 test: case '^':
Executed by:
  • Self test
'^':
executed 8 times by 1 test: case '^':
Executed by:
  • Self test
8
1169 case
executed 18 times by 1 test: case '~':
Executed by:
  • Self test
'~':
executed 18 times by 1 test: case '~':
Executed by:
  • Self test
18
1170 return
executed 267627 times by 1 test: return 1;
Executed by:
  • Self test
1;
executed 267627 times by 1 test: return 1;
Executed by:
  • Self test
267627
1171 case
executed 360 times by 1 test: case '?':
Executed by:
  • Self test
'?':
executed 360 times by 1 test: case '?':
Executed by:
  • Self test
360
1172 case
executed 238 times by 1 test: case ':':
Executed by:
  • Self test
':':
executed 238 times by 1 test: case ':':
Executed by:
  • Self test
238
1173 case
executed 39627 times by 1 test: case ',':
Executed by:
  • Self test
',':
executed 39627 times by 1 test: case ',':
Executed by:
  • Self test
39627
1174 return
executed 40225 times by 1 test: return 1;
Executed by:
  • Self test
1;
executed 40225 times by 1 test: return 1;
Executed by:
  • Self test
40225
1175 default
executed 65 times by 1 test: default:
Executed by:
  • Self test
:
executed 65 times by 1 test: default:
Executed by:
  • Self test
65
1176 return
executed 65 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 65 times by 1 test: return 0;
Executed by:
  • Self test
65
1177 }-
1178}-
1179-
1180-
1181-
1182-
1183-
1184static void-
1185readtok ()-
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
cpDescription
TRUEevaluated 57559084 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (
(c = *cp)Description
TRUEevaluated 43010907 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14548177 times by 1 test
Evaluated by:
  • Self test
c = *cp)
(c = *cp)Description
TRUEevaluated 43010907 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14548177 times by 1 test
Evaluated by:
  • Self test
&& (((((
((c) == ' ')Description
TRUEevaluated 531554 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
c) == ' ')
((c) == ' ')Description
TRUEevaluated 531554 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
|| ((
((c) == '\t')Description
TRUEnever evaluated
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
c) == '\t')
((c) == '\t')Description
TRUEnever evaluated
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
) || ((
((c) == '\n')Description
TRUEnever evaluated
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
c) == '\n')
((c) == '\n')Description
TRUEnever evaluated
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
)))
0-57559084
1196 cp++;
executed 531554 times by 1 test: cp++;
Executed by:
  • Self test
531554
1197-
1198 if (c
cDescription
TRUEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14548177 times by 1 test
Evaluated by:
  • Self test
)
14548177-42479353
1199 cp++;
executed 42479353 times by 1 test: cp++;
Executed by:
  • Self test
42479353
1200-
1201 if (c == '\0'
c == '\0'Description
TRUEevaluated 14548177 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 42479353 times by 1 test
Evaluated by:
  • Self test
)
14548177-42479353
1202 {-
1203 lasttok = curtok;-
1204 curtok = 0;-
1205 tp = cp;-
1206 return;
executed 14548177 times by 1 test: return;
Executed by:
  • Self test
14548177
1207 }-
1208 lasttp = tp = cp - 1;-
1209-
1210 if (((1 && -
1211 ((*
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 7289797 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35189556 times by 1 test
Evaluated by:
  • Self test
__ctype_b_loc ())[(int) ((
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 7289797 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35189556 times by 1 test
Evaluated by:
  • Self test
7289797-35189556
1212 (unsigned char)c
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 7289797 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35189556 times by 1 test
Evaluated by:
  • Self test
7289797-35189556
1213 ))] & (unsigned short int) _ISalpha)
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 7289797 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35189556 times by 1 test
Evaluated by:
  • Self test
7289797-35189556
1214 ) || (
(c == '_')Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35189460 times by 1 test
Evaluated by:
  • Self test
c == '_')
(c == '_')Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35189460 times by 1 test
Evaluated by:
  • Self test
))
96-35189460
1215 {-
1216-
1217 char *savecp;-
1218 EXPR_CONTEXT ec;-
1219 int peektok;-
1220-
1221 while (((1 && -
1222 ((*
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 39686936 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7292253 times by 1 test
Evaluated by:
  • Self test
__ctype_b_loc ())[(int) ((
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 39686936 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7292253 times by 1 test
Evaluated by:
  • Self test
7292253-39686936
1223 (unsigned char)c
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 39686936 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7292253 times by 1 test
Evaluated by:
  • Self test
7292253-39686936
1224 ))] & (unsigned short int) _ISalnum)
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 39686936 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7292253 times by 1 test
Evaluated by:
  • Self test
7292253-39686936
1225 ) || c == '_'
c == '_'Description
TRUEevaluated 2360 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7289893 times by 1 test
Evaluated by:
  • Self test
))
2360-7289893
1226 c = *cp++;
executed 39689296 times by 1 test: c = *cp++;
Executed by:
  • Self test
39689296
1227-
1228 c = *--cp;-
1229-
1230-
1231 if (c == '['
c == '['Description
TRUEevaluated 10154 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7279739 times by 1 test
Evaluated by:
  • Self test
)
10154-7279739
1232 {-
1233 e = skipsubscript (cp, 0, 1);-
1234 if (cp[e] == ']'
cp[e] == ']'Description
TRUEevaluated 10154 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-10154
1235 {-
1236 cp += e + 1;-
1237 c = *cp;-
1238 e = ']';-
1239 }
executed 10154 times by 1 test: end of block
Executed by:
  • Self test
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
curlval.tokstrDescription
TRUEevaluated 44688 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7245205 times by 1 test
Evaluated by:
  • Self test
&& curlval.tokstr == tokstr
curlval.tokstr == tokstrDescription
TRUEevaluated 44679 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
)
9-7245205
1248 init_lvalue (&curlval);
executed 44679 times by 1 test: init_lvalue (&curlval);
Executed by:
  • Self test
44679
1249-
1250 do { if (tokstr
tokstrDescription
TRUEevaluated 45322 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7244571 times by 1 test
Evaluated by:
  • Self test
) sh_xfree((tokstr), "expr.c", 1332);
executed 45322 times by 1 test: sh_xfree((tokstr), "expr.c", 1332);
Executed by:
  • Self test
} while (0);
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
peektok == 5Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7289883 times by 1 test
Evaluated by:
  • Self test
)
9-7289883
1265 do { if (tokstr
tokstrDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((tokstr), "expr.c", 1345);
executed 9 times by 1 test: sh_xfree((tokstr), "expr.c", 1345);
Executed by:
  • Self test
}
executed 9 times by 1 test: end of block
Executed by:
  • Self test
while (0);
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
lasttok == 14Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7289860 times by 1 test
Evaluated by:
  • Self test
|| lasttok == 15
lasttok == 15Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7289844 times by 1 test
Evaluated by:
  • Self test
|| peektok != '='
peektok != '='Description
TRUEevaluated 7287236 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2608 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
7287274
1276 else-
1277 tokval = 0;
executed 2608 times by 1 test: tokval = 0;
Executed by:
  • Self test
2608
1278-
1279 lasttok = curtok;-
1280 curtok = 5;-
1281 }
executed 7289882 times by 1 test: end of block
Executed by:
  • Self test
7289882
1282 else if (((
(c) >= '0'Description
TRUEevaluated 14008144 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21181316 times by 1 test
Evaluated by:
  • Self test
c) >= '0'
(c) >= '0'Description
TRUEevaluated 14008144 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21181316 times by 1 test
Evaluated by:
  • Self test
&& (
(c) <= '9'Description
TRUEevaluated 13898339 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 109805 times by 1 test
Evaluated by:
  • Self test
c) <= '9'
(c) <= '9'Description
TRUEevaluated 13898339 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 109805 times by 1 test
Evaluated by:
  • Self test
))
109805-21181316
1283 {-
1284 while ((1 && -
1285 ((*
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33140000 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898513 times by 1 test
Evaluated by:
  • Self test
__ctype_b_loc ())[(int) ((
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33140000 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898513 times by 1 test
Evaluated by:
  • Self test
13898513-33140000
1286 (unsigned char)c
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33140000 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898513 times by 1 test
Evaluated by:
  • Self test
13898513-33140000
1287 ))] & (unsigned short int) _ISalnum)
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33140000 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898513 times by 1 test
Evaluated by:
  • Self test
13898513-33140000
1288 ) || c == '#'
c == '#'Description
TRUEevaluated 158 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898355 times by 1 test
Evaluated by:
  • Self test
|| c == '@'
c == '@'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898347 times by 1 test
Evaluated by:
  • Self test
|| c == '_'
c == '_'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13898339 times by 1 test
Evaluated by:
  • Self test
)
8-13898355
1289 c = *cp++;
executed 33140174 times by 1 test: c = *cp++;
Executed by:
  • Self test
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:
  • Self test
13898307
1299 else-
1300 {-
1301 c1 = *cp++;-
1302 if ((
(c == '=')Description
TRUEevaluated 7955 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21283166 times by 1 test
Evaluated by:
  • Self test
c == '=')
(c == '=')Description
TRUEevaluated 7955 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21283166 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '=')Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7860 times by 1 test
Evaluated by:
  • Self test
c1 == '=')
(c1 == '=')Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7860 times by 1 test
Evaluated by:
  • Self test
)
95-21283166
1303 c = 1;
executed 95 times by 1 test: c = 1;
Executed by:
  • Self test
95
1304 else if ((
(c == '!')Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21290985 times by 1 test
Evaluated by:
  • Self test
c == '!')
(c == '!')Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21290985 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '=')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test
c1 == '=')
(c1 == '=')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test
)
15-21290985
1305 c = 2;
executed 26 times by 1 test: c = 2;
Executed by:
  • Self test
26
1306 else if ((
(c == '>')Description
TRUEevaluated 11727 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21279273 times by 1 test
Evaluated by:
  • Self test
c == '>')
(c == '>')Description
TRUEevaluated 11727 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21279273 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '=')Description
TRUEevaluated 4859 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6868 times by 1 test
Evaluated by:
  • Self test
c1 == '=')
(c1 == '=')Description
TRUEevaluated 4859 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6868 times by 1 test
Evaluated by:
  • Self test
)
4859-21279273
1307 c = 4;
executed 4859 times by 1 test: c = 4;
Executed by:
  • Self test
4859
1308 else if ((
(c == '<')Description
TRUEevaluated 69555 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21216586 times by 1 test
Evaluated by:
  • Self test
c == '<')
(c == '<')Description
TRUEevaluated 69555 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21216586 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '=')Description
TRUEevaluated 19881 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49674 times by 1 test
Evaluated by:
  • Self test
c1 == '=')
(c1 == '=')Description
TRUEevaluated 19881 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49674 times by 1 test
Evaluated by:
  • Self test
)
19881-21216586
1309 c = 3;
executed 19881 times by 1 test: c = 3;
Executed by:
  • Self test
19881
1310 else if ((
(c == '<')Description
TRUEevaluated 49674 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21216586 times by 1 test
Evaluated by:
  • Self test
c == '<')
(c == '<')Description
TRUEevaluated 49674 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21216586 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '<')Description
TRUEevaluated 59 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49615 times by 1 test
Evaluated by:
  • Self test
c1 == '<')
(c1 == '<')Description
TRUEevaluated 59 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 49615 times by 1 test
Evaluated by:
  • Self test
)
59-21216586
1311 {-
1312 if (*
*cp == '='Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test
cp == '='
*cp == '='Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test
)
11-48
1313 {-
1314 assigntok = 9;-
1315 c = 11;-
1316 cp++;-
1317 }
executed 48 times by 1 test: end of block
Executed by:
  • Self test
48
1318 else-
1319 c = 9;
executed 11 times by 1 test: c = 9;
Executed by:
  • Self test
11
1320 }-
1321 else if ((
(c == '>')Description
TRUEevaluated 6868 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21259333 times by 1 test
Evaluated by:
  • Self test
c == '>')
(c == '>')Description
TRUEevaluated 6868 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21259333 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '>')Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6820 times by 1 test
Evaluated by:
  • Self test
c1 == '>')
(c1 == '>')Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6820 times by 1 test
Evaluated by:
  • Self test
)
48-21259333
1322 {-
1323 if (*
*cp == '='Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 24 times by 1 test
Evaluated by:
  • Self test
cp == '='
*cp == '='Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 24 times by 1 test
Evaluated by:
  • Self test
)
24
1324 {-
1325 assigntok = 10;-
1326 c = 11;-
1327 cp++;-
1328 }
executed 24 times by 1 test: end of block
Executed by:
  • Self test
24
1329 else-
1330 c = 10;
executed 24 times by 1 test: c = 10;
Executed by:
  • Self test
24
1331 }-
1332 else if ((
(c == '&')Description
TRUEevaluated 207 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21265946 times by 1 test
Evaluated by:
  • Self test
c == '&')
(c == '&')Description
TRUEevaluated 207 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21265946 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '&')Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 82 times by 1 test
Evaluated by:
  • Self test
c1 == '&')
(c1 == '&')Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 82 times by 1 test
Evaluated by:
  • Self test
)
82-21265946
1333 c = 7;
executed 125 times by 1 test: c = 7;
Executed by:
  • Self test
125
1334 else if ((
(c == '|')Description
TRUEevaluated 19926 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21246102 times by 1 test
Evaluated by:
  • Self test
c == '|')
(c == '|')Description
TRUEevaluated 19926 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21246102 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '|')Description
TRUEevaluated 19837 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 89 times by 1 test
Evaluated by:
  • Self test
c1 == '|')
(c1 == '|')Description
TRUEevaluated 19837 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 89 times by 1 test
Evaluated by:
  • Self test
)
89-21246102
1335 c = 8;
executed 19837 times by 1 test: c = 8;
Executed by:
  • Self test
19837
1336 else if ((
(c == '*')Description
TRUEevaluated 59519 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21186672 times by 1 test
Evaluated by:
  • Self test
c == '*')
(c == '*')Description
TRUEevaluated 59519 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 21186672 times by 1 test
Evaluated by:
  • Self test
&& (
(c1 == '*')Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 59486 times by 1 test
Evaluated by:
  • Self test
c1 == '*')
(c1 == '*')Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 59486 times by 1 test
Evaluated by:
  • Self test
)
33-21186672
1337 c = 13;
executed 33 times by 1 test: c = 13;
Executed by:
  • Self test
33
1338 else if ((c == '-'
c == '-'Description
TRUEevaluated 1354361 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19891797 times by 1 test
Evaluated by:
  • Self test
|| c == '+'
c == '+'Description
TRUEevaluated 19586057 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 305740 times by 1 test
Evaluated by:
  • Self test
) && c1 == c
c1 == cDescription
TRUEevaluated 1420732 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19519686 times by 1 test
Evaluated by:
  • Self test
&& curtok == 5
curtok == 5Description
TRUEevaluated 1420630 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 102 times by 1 test
Evaluated by:
  • Self test
)
102-19891797
1339 c = (
(c == '-')Description
TRUEevaluated 1323966 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 96664 times by 1 test
Evaluated by:
  • Self test
c == '-')
(c == '-')Description
TRUEevaluated 1323966 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 96664 times by 1 test
Evaluated by:
  • Self test
? 17 : 16;
executed 1420630 times by 1 test: c = (c == '-') ? 17 : 16;
Executed by:
  • Self test
96664-1420630
1340 else if ((c == '-'
c == '-'Description
TRUEevaluated 30395 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19795133 times by 1 test
Evaluated by:
  • Self test
|| c == '+'
c == '+'Description
TRUEevaluated 19489393 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 305740 times by 1 test
Evaluated by:
  • Self test
) && c1 == c
c1 == cDescription
TRUEevaluated 102 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19519686 times by 1 test
Evaluated by:
  • Self test
&& curtok == 6
curtok == 6Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 90 times by 1 test
Evaluated by:
  • Self test
&& (lasttok == 14
lasttok == 14Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test
|| lasttok == 15
lasttok == 15Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test
))
0-19795133
1341 {-
1342-
1343 if (c == '-'
c == '-'Description
TRUEnever evaluated
FALSEnever evaluated
)
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 == '-'
c == '-'Description
TRUEevaluated 30395 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19795133 times by 1 test
Evaluated by:
  • Self test
|| c == '+'
c == '+'Description
TRUEevaluated 19489393 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 305740 times by 1 test
Evaluated by:
  • Self test
) && c1 == c
c1 == cDescription
TRUEevaluated 102 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 19519686 times by 1 test
Evaluated by:
  • Self test
)
102-19795133
1349 {-
1350-
1351-
1352 xp = cp;-
1353 while (xp
xpDescription
TRUEevaluated 128 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& *
*xpDescription
TRUEevaluated 114 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
xp
*xpDescription
TRUEevaluated 114 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
&& ((((*
((*xp) == ' ')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test
xp) == ' ')
((*xp) == ' ')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test
|| ((*
((*xp) == '\t')Description
TRUEnever evaluated
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test
xp) == '\t')
((*xp) == '\t')Description
TRUEnever evaluated
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test
) || ((*
((*xp) == '\n')Description
TRUEnever evaluated
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test
xp) == '\n')
((*xp) == '\n')Description
TRUEnever evaluated
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test
))
0-128
1354 xp++;
executed 26 times by 1 test: xp++;
Executed by:
  • Self test
26
1355 if (((1 && -
1356 ((*
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test
__ctype_b_loc ())[(int) ((
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test
48-54
1357 (unsigned char)(unsigned char)*xp
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test
48-54
1358 ))] & (unsigned short int) _ISalpha)
((*__ctype_b_l...int) _ISalpha)Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test
48-54
1359 ) || ((
((unsigned char)*xp == '_')Description
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test
unsigned char)*xp == '_')
((unsigned char)*xp == '_')Description
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test
))
0-54
1360 c = (
(c == '-')Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 32 times by 1 test
Evaluated by:
  • Self test
c == '-')
(c == '-')Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 32 times by 1 test
Evaluated by:
  • Self test
? 15 : 14;
executed 48 times by 1 test: c = (c == '-') ? 15 : 14;
Executed by:
  • Self test
16-48
1361 else-
1362 cp--;
executed 54 times by 1 test: cp--;
Executed by:
  • Self test
54
1363-
1364 }-
1365 else if (c1 == '='
c1 == '='Description
TRUEevaluated 19517526 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 307900 times by 1 test
Evaluated by:
  • Self test
&& ((
((c) ? ((char ...id *)0) ) : 0)Description
TRUEevaluated 19517526 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
c) ? ((char *)mbschr (("*/%+-&^|"), (c)) != (char *)
((c) ? ((char ...id *)0) ) : 0)Description
TRUEevaluated 19517526 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
0-19517526
1366 ((void *)0)
((c) ? ((char ...id *)0) ) : 0)Description
TRUEevaluated 19517526 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
0-19517526
1367 ) : 0)
((c) ? ((char ...id *)0) ) : 0)Description
TRUEevaluated 19517526 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-19517526
1368 {-
1369 assigntok = c;-
1370 c = 11;-
1371 }
executed 19517526 times by 1 test: end of block
Executed by:
  • Self test
19517526
1372 else if (_is_arithop (c) == 0
_is_arithop (c) == 0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 307852 times by 1 test
Evaluated by:
  • Self test
)
48-307852
1373 {-
1374 cp--;-
1375-
1376 if (curtok == 0
curtok == 0Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test
|| _is_arithop (curtok)
_is_arithop (curtok)Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test
|| _is_multiop (curtok)
_is_multiop (curtok)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
0-31
1377 evalerror (
executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
47
1378 dcgettext (((void *)0),
executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
47
1379 "syntax error: operand expected"
executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
47
1380 , 5)
executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
47
1381 );
executed 47 times by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: operand expected" , 5) );
Executed by:
  • Self test
47
1382 else-
1383 evalerror (
executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) );
Executed by:
  • Self test
1
1384 dcgettext (((void *)0),
executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) );
Executed by:
  • Self test
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:
  • Self test
1
1386 , 5)
executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) );
Executed by:
  • Self test
1
1387 );
executed 1 time by 1 test: evalerror ( dcgettext (((void *)0), "syntax error: invalid arithmetic operator" , 5) );
Executed by:
  • Self test
1
1388 }-
1389 else-
1390 cp--;
executed 307852 times by 1 test: cp--;
Executed by:
  • Self test
307852
1391-
1392-
1393-
1394-
1395-
1396 lasttok = curtok;-
1397 curtok = c;-
1398 }
executed 21291073 times by 1 test: end of block
Executed by:
  • Self test
21291073
1399 tp = cp;-
1400}
executed 42479262 times by 1 test: end of block
Executed by:
  • Self test
42479262
1401-
1402static void-
1403evalerror (msg)-
1404 const char *msg;-
1405{-
1406 char *name, *t;-
1407-
1408 name = this_command_name;-
1409 for (t = expression; t
tDescription
TRUEevaluated 332 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (((*
((*t) == ' ')Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 207 times by 1 test
Evaluated by:
  • Self test
t) == ' ')
((*t) == ' ')Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 207 times by 1 test
Evaluated by:
  • Self test
|| ((*
((*t) == '\t')Description
TRUEnever evaluated
FALSEevaluated 207 times by 1 test
Evaluated by:
  • Self test
t) == '\t')
((*t) == '\t')Description
TRUEnever evaluated
FALSEevaluated 207 times by 1 test
Evaluated by:
  • Self test
); t++)
0-332
1410 ;
executed 125 times by 1 test: ;
Executed by:
  • Self test
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
1420static intmax_t-
1421strlong (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 (*
*s == '0'Description
TRUEevaluated 35809 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13862530 times by 1 test
Evaluated by:
  • Self test
s == '0'
*s == '0'Description
TRUEevaluated 35809 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13862530 times by 1 test
Evaluated by:
  • Self test
)
35809-13862530
1434 {-
1435 s++;-
1436-
1437 if (*
*s == '\0'Description
TRUEevaluated 34001 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1808 times by 1 test
Evaluated by:
  • Self test
s == '\0'
*s == '\0'Description
TRUEevaluated 34001 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1808 times by 1 test
Evaluated by:
  • Self test
)
1808-34001
1438 return
executed 34001 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 34001 times by 1 test: return 0;
Executed by:
  • Self test
34001
1439-
1440-
1441 if (*
*s == 'x'Description
TRUEevaluated 1792 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
s == 'x'
*s == 'x'Description
TRUEevaluated 1792 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
|| *
*s == 'X'Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
s == 'X'
*s == 'X'Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
)
0-1792
1442 {-
1443 base = 16;-
1444 s++;-
1445 }
executed 1792 times by 1 test: end of block
Executed by:
  • Self test
1792
1446 else-
1447 base = 8;
executed 16 times by 1 test: base = 8;
Executed by:
  • Self test
16
1448 foundbase++;-
1449 }
executed 1808 times by 1 test: end of block
Executed by:
  • Self test
1808
1450-
1451 val = 0;-
1452 for (c = *s++; c
cDescription
TRUEevaluated 33102525 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13864306 times by 1 test
Evaluated by:
  • Self test
; c = *s++)
13864306-33102525
1453 {-
1454 if (c == '#'
c == '#'Description
TRUEevaluated 158 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 33102367 times by 1 test
Evaluated by:
  • Self test
)
158-33102367
1455 {-
1456 if (foundbase
foundbaseDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 142 times by 1 test
Evaluated by:
  • Self test
)
16-142
1457 evalerror (
executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) );
Executed by:
  • Self test
16
1458 dcgettext (((void *)0),
executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) );
Executed by:
  • Self test
16
1459 "invalid number"
executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) );
Executed by:
  • Self test
16
1460 , 5)
executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) );
Executed by:
  • Self test
16
1461 );
executed 16 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid number" , 5) );
Executed by:
  • Self test
16
1462-
1463-
1464 if (val < 2
val < 2Description
TRUEnever evaluated
FALSEevaluated 142 times by 1 test
Evaluated by:
  • Self test
|| val > 64
val > 64Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 134 times by 1 test
Evaluated by:
  • Self test
)
0-142
1465 evalerror (
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) );
Executed by:
  • Self test
8
1466 dcgettext (((void *)0),
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) );
Executed by:
  • Self test
8
1467 "invalid arithmetic base"
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) );
Executed by:
  • Self test
8
1468 , 5)
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) );
Executed by:
  • Self test
8
1469 );
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "invalid arithmetic base" , 5) );
Executed by:
  • Self test
8
1470-
1471 base = val;-
1472 val = 0;-
1473 foundbase++;-
1474 }
executed 134 times by 1 test: end of block
Executed by:
  • Self test
134
1475 else if ((1 && -
1476 ((*
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33102351 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
__ctype_b_loc ())[(int) ((
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33102351 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
16-33102351
1477 (unsigned char)c
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33102351 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
16-33102351
1478 ))] & (unsigned short int) _ISalnum)
((*__ctype_b_l...int) _ISalnum)Description
TRUEevaluated 33102351 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
16-33102351
1479 ) || (
(c == '_')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
c == '_')
(c == '_')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
|| (
(c == '@')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
c == '@')
(c == '@')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-8
1480 {-
1481 if (((
(c) >= '0'Description
TRUEevaluated 33102367 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
c) >= '0'
(c) >= '0'Description
TRUEevaluated 33102367 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (
(c) <= '9'Description
TRUEevaluated 33100977 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1390 times by 1 test
Evaluated by:
  • Self test
c) <= '9'
(c) <= '9'Description
TRUEevaluated 33100977 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1390 times by 1 test
Evaluated by:
  • Self test
))
0-33102367
1482 c = ((c) - '0');
executed 33100977 times by 1 test: c = ((c) - '0');
Executed by:
  • Self test
33100977
1483 else if (c >= 'a'
c >= 'a'Description
TRUEevaluated 1127 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 263 times by 1 test
Evaluated by:
  • Self test
&& c <= 'z'
c <= 'z'Description
TRUEevaluated 1127 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-1127
1484 c -= 'a' - 10;
executed 1127 times by 1 test: c -= 'a' - 10;
Executed by:
  • Self test
1127
1485 else if (c >= 'A'
c >= 'A'Description
TRUEevaluated 255 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
&& c <= 'Z'
c <= 'Z'Description
TRUEevaluated 247 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
8-255
1486 c -= 'A' - ((
(base <= 36)Description
TRUEevaluated 231 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
base <= 36)
(base <= 36)Description
TRUEevaluated 231 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test
? 10 : 36);
executed 247 times by 1 test: c -= 'A' - ((base <= 36) ? 10 : 36);
Executed by:
  • Self test
16-247
1487 else if (c == '@'
c == '@'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
8
1488 c = 62;
executed 8 times by 1 test: c = 62;
Executed by:
  • Self test
8
1489 else if (c == '_'
c == '_'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-8
1490 c = 63;
executed 8 times by 1 test: c = 63;
Executed by:
  • Self test
8
1491-
1492 if (c >= base
c >= baseDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 33102359 times by 1 test
Evaluated by:
  • Self test
)
8-33102359
1493 evalerror (
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) );
Executed by:
  • Self test
8
1494 dcgettext (((void *)0),
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) );
Executed by:
  • Self test
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:
  • Self test
8
1496 , 5)
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) );
Executed by:
  • Self test
8
1497 );
executed 8 times by 1 test: evalerror ( dcgettext (((void *)0), "value too great for base" , 5) );
Executed by:
  • Self test
8
1498-
1499 val = (val * base) + c;-
1500 }
executed 33102359 times by 1 test: end of block
Executed by:
  • Self test
33102359
1501 else-
1502 break;
never executed: break;
0
1503 }-
1504-
1505 return
executed 13864306 times by 1 test: return (val);
Executed by:
  • Self test
(val);
executed 13864306 times by 1 test: return (val);
Executed by:
  • Self test
13864306
1506}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2