Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | int parse_and_execute_level = 0; | - |
24 | | - |
25 | static int cat_file (REDIRECT *); | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | static void | - |
32 | set_history_remembering () | - |
33 | { | - |
34 | remember_on_history = enable_history_list; | - |
35 | }executed 723716 times by 1 test: end of block | 723716 |
36 | | - |
37 | | - |
38 | static void | - |
39 | restore_lastcom (x) | - |
40 | char *x; | - |
41 | { | - |
42 | do { if (the_printed_command_except_trapTRUE | evaluated 724704 times by 1 test | FALSE | never evaluated |
) sh_xfree((the_printed_command_except_trap), "evalstring.c", 83);executed 724704 times by 1 test: sh_xfree((the_printed_command_except_trap), "evalstring.c", 83); } while (0); | 0-724704 |
43 | the_printed_command_except_trap = x; | - |
44 | }executed 724704 times by 1 test: end of block | 724704 |
45 | | - |
46 | int | - |
47 | should_suppress_fork (command) | - |
48 | COMMAND *command; | - |
49 | { | - |
50 | returnexecuted 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); (startup_state == 2 && parse_and_execute_level == 1 &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
51 | running_trap == 0 &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
52 | *bash_input.location.string == '\0' &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
53 | command->type == cm_simple &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
54 | signal_is_trapped (0) == 0 &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
55 | signal_is_trapped (executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
56 | 65executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
57 | +1) == 0 &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
58 | any_signals_trapped () < 0 &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
59 | command->redirects == 0 && command->value.Simple->redirects == 0 &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
60 | ((command->flags & 0x80) == 0) &&executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
61 | ((command->flags & 0x04) == 0));executed 22988 times by 1 test: return (startup_state == 2 && parse_and_execute_level == 1 && running_trap == 0 && *bash_input.location.string == '\0' && command->type == cm_simple && signal_is_trapped (0) == 0 && signal_is_trapped ( 65 +1) == 0 && any_signals_trapped () < 0 && command->redirects == 0 && command->value.Simple->redirects == 0 && ((command->flags & 0x80) == 0) && ((command->flags & 0x04) == 0)); | 22988 |
62 | } | - |
63 | | - |
64 | void | - |
65 | optimize_fork (command) | - |
66 | COMMAND *command; | - |
67 | { | - |
68 | if (command->type == cm_connectionTRUE | evaluated 11199 times by 1 test | FALSE | never evaluated |
&& | 0-11199 |
69 | (command->value.Connection->connector == 288TRUE | evaluated 29 times by 1 test | FALSE | evaluated 11170 times by 1 test |
|| command->value.Connection->connector == 289TRUE | evaluated 25 times by 1 test | FALSE | evaluated 11145 times by 1 test |
) && | 25-11170 |
70 | should_suppress_fork (command->value.Connection->second)TRUE | evaluated 4 times by 1 test | FALSE | evaluated 50 times by 1 test |
) | 4-50 |
71 | { | - |
72 | command->value.Connection->second->flags |= 0x40; | - |
73 | command->value.Connection->second->value.Simple->flags |= 0x40; | - |
74 | }executed 4 times by 1 test: end of block | 4 |
75 | }executed 11199 times by 1 test: end of block | 11199 |
76 | | - |
77 | void | - |
78 | optimize_subshell_command (command) | - |
79 | COMMAND *command; | - |
80 | { | - |
81 | if (running_trap == 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
82 | command->type == cm_simpleTRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
83 | signal_is_trapped (0) == 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
84 | signal_is_trapped (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
85 | 65TRUE | never evaluated | FALSE | never evaluated |
| 0 |
86 | +1) == 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
87 | any_signals_trapped () < 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
88 | command->redirects == 0TRUE | never evaluated | FALSE | never evaluated |
&& command->value.Simple->redirects == 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
89 | ((TRUE | never evaluated | FALSE | never evaluated |
command->flags & 0x80) == 0)TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
90 | ((TRUE | never evaluated | FALSE | never evaluated |
command->flags & 0x04) == 0)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
91 | { | - |
92 | command->flags |= 0x40; | - |
93 | command->value.Simple->flags |= 0x40; | - |
94 | } never executed: end of block | 0 |
95 | else if (command->type == cm_connectionTRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
96 | (command->value.Connection->connector == 288TRUE | never evaluated | FALSE | never evaluated |
|| command->value.Connection->connector == 289TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
97 | optimize_subshell_command (command->value.Connection->second); never executed: optimize_subshell_command (command->value.Connection->second); | 0 |
98 | } never executed: end of block | 0 |
99 | | - |
100 | | - |
101 | void | - |
102 | parse_and_execute_cleanup () | - |
103 | { | - |
104 | if (running_trapTRUE | never evaluated | FALSE | evaluated 8 times by 1 test |
) | 0-8 |
105 | { | - |
106 | run_trap_cleanup (running_trap - 1); | - |
107 | unfreeze_jobs_list (); | - |
108 | } never executed: end of block | 0 |
109 | | - |
110 | if (have_unwind_protects ()TRUE | evaluated 8 times by 1 test | FALSE | never evaluated |
) | 0-8 |
111 | run_unwind_frame ("parse_and_execute top");executed 8 times by 1 test: run_unwind_frame ("parse_and_execute top"); | 8 |
112 | else | - |
113 | parse_and_execute_level = 0; never executed: parse_and_execute_level = 0; | 0 |
114 | } | - |
115 | | - |
116 | static void | - |
117 | parse_prologue (string, flags, tag) | - |
118 | char *string; | - |
119 | int flags; | - |
120 | char *tag; | - |
121 | { | - |
122 | char *orig_string, *lastcom; | - |
123 | int x; | - |
124 | | - |
125 | orig_string = string; | - |
126 | | - |
127 | begin_unwind_frame (tag); | - |
128 | unwind_protect_mem ((char *)&(parse_and_execute_level), sizeof (parse_and_execute_level)); | - |
129 | unwind_protect_mem ((char *)&(top_level), sizeof (top_level)); | - |
130 | unwind_protect_mem ((char *)&(indirection_level), sizeof (indirection_level)); | - |
131 | unwind_protect_mem ((char *)&(line_number), sizeof (line_number)); | - |
132 | unwind_protect_mem ((char *)&(line_number_for_err_trap), sizeof (line_number_for_err_trap)); | - |
133 | unwind_protect_mem ((char *)&(loop_level), sizeof (loop_level)); | - |
134 | unwind_protect_mem ((char *)&(executing_list), sizeof (executing_list)); | - |
135 | unwind_protect_mem ((char *)&(comsub_ignore_return), sizeof (comsub_ignore_return)); | - |
136 | if (flags & (0x001|0x002)TRUE | evaluated 708857 times by 1 test | FALSE | evaluated 17710 times by 1 test |
) | 17710-708857 |
137 | unwind_protect_mem ((char *)&(interactive), sizeof (interactive));executed 708857 times by 1 test: unwind_protect_mem ((char *)&(interactive), sizeof (interactive)); | 708857 |
138 | | - |
139 | | - |
140 | if (parse_and_execute_level == 0TRUE | evaluated 725357 times by 1 test | FALSE | evaluated 1210 times by 1 test |
) | 1210-725357 |
141 | add_unwind_protect (set_history_remembering, (char *)executed 725357 times by 1 test: add_unwind_protect (set_history_remembering, (char *) ((void *)0) ); | 725357 |
142 | ((void *)0)executed 725357 times by 1 test: add_unwind_protect (set_history_remembering, (char *) ((void *)0) ); | 725357 |
143 | );executed 725357 times by 1 test: add_unwind_protect (set_history_remembering, (char *) ((void *)0) ); | 725357 |
144 | else | - |
145 | unwind_protect_mem ((char *)&(remember_on_history), sizeof (remember_on_history));executed 1210 times by 1 test: unwind_protect_mem ((char *)&(remember_on_history), sizeof (remember_on_history)); | 1210 |
146 | | - |
147 | unwind_protect_mem ((char *)&(history_expansion_inhibited), sizeof (history_expansion_inhibited)); | - |
148 | | - |
149 | | - |
150 | | - |
151 | if (interactive_shellTRUE | evaluated 17 times by 1 test | FALSE | evaluated 726550 times by 1 test |
) | 17-726550 |
152 | { | - |
153 | x = get_current_prompt_level (); | - |
154 | add_unwind_protect (set_current_prompt_level, x); | - |
155 | }executed 17 times by 1 test: end of block | 17 |
156 | | - |
157 | if (the_printed_command_except_trapTRUE | evaluated 726323 times by 1 test | FALSE | evaluated 244 times by 1 test |
) | 244-726323 |
158 | { | - |
159 | lastcom = (char *)strcpy (sh_xmalloc((1 + strlen (the_printed_command_except_trap)), "evalstring.c", 194), (the_printed_command_except_trap)); | - |
160 | add_unwind_protect (restore_lastcom, lastcom); | - |
161 | }executed 726323 times by 1 test: end of block | 726323 |
162 | | - |
163 | add_unwind_protect (pop_stream, (char *) | - |
164 | ((void *)0) | - |
165 | ); | - |
166 | if (parser_expanding_alias ()TRUE | evaluated 18 times by 1 test | FALSE | evaluated 726549 times by 1 test |
) | 18-726549 |
167 | add_unwind_protect (parser_restore_alias, (char *)executed 18 times by 1 test: add_unwind_protect (parser_restore_alias, (char *) ((void *)0) ); | 18 |
168 | ((void *)0)executed 18 times by 1 test: add_unwind_protect (parser_restore_alias, (char *) ((void *)0) ); | 18 |
169 | );executed 18 times by 1 test: add_unwind_protect (parser_restore_alias, (char *) ((void *)0) ); | 18 |
170 | | - |
171 | if (orig_stringTRUE | evaluated 726567 times by 1 test | FALSE | never evaluated |
&& ((TRUE | evaluated 21260 times by 1 test | FALSE | evaluated 705307 times by 1 test |
flags & 0x008) == 0)TRUE | evaluated 21260 times by 1 test | FALSE | evaluated 705307 times by 1 test |
) | 0-726567 |
172 | add_unwind_protect (xfree, orig_string);executed 21260 times by 1 test: add_unwind_protect (xfree, orig_string); | 21260 |
173 | ; | - |
174 | | - |
175 | if (flags & (0x001|0x002)TRUE | evaluated 708857 times by 1 test | FALSE | evaluated 17710 times by 1 test |
) | 17710-708857 |
176 | interactive = (TRUE | evaluated 708857 times by 1 test | FALSE | never evaluated |
flags & 0x001)TRUE | evaluated 708857 times by 1 test | FALSE | never evaluated |
? 0 : 1;executed 708857 times by 1 test: interactive = (flags & 0x001) ? 0 : 1; | 0-708857 |
177 | | - |
178 | | - |
179 | if (flags & 0x004TRUE | evaluated 726565 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 2-726565 |
180 | bash_history_disable ();executed 726565 times by 1 test: bash_history_disable (); | 726565 |
181 | | - |
182 | if (flags & 0x200TRUE | never evaluated | FALSE | evaluated 726567 times by 1 test |
) | 0-726567 |
183 | history_expansion_inhibited = 1; never executed: history_expansion_inhibited = 1; | 0 |
184 | | - |
185 | | - |
186 | }executed 726567 times by 1 test: end of block | 726567 |
187 | int | - |
188 | parse_and_execute (string, from_file, flags) | - |
189 | char *string; | - |
190 | const char *from_file; | - |
191 | int flags; | - |
192 | { | - |
193 | int code, lreset; | - |
194 | volatile int should_jump_to_top_level, last_result; | - |
195 | COMMAND *volatile command; | - |
196 | volatile sigset_t pe_sigmask; | - |
197 | | - |
198 | parse_prologue (string, flags, "parse_and_execute top"); | - |
199 | | - |
200 | parse_and_execute_level++; | - |
201 | | - |
202 | lreset = flags & 0x010; | - |
203 | | - |
204 | | - |
205 | | - |
206 | sigemptyset ((sigset_t *)&pe_sigmask); | - |
207 | sigprocmask ( | - |
208 | 0 | - |
209 | , (sigset_t *) | - |
210 | ((void *)0) | - |
211 | , (sigset_t *)&pe_sigmask); | - |
212 | | - |
213 | | - |
214 | | - |
215 | | - |
216 | | - |
217 | | - |
218 | push_stream (lreset); | - |
219 | if (parser_expanding_alias ()TRUE | evaluated 18 times by 1 test | FALSE | evaluated 21242 times by 1 test |
) | 18-21242 |
220 | | - |
221 | parser_save_alias ();executed 18 times by 1 test: parser_save_alias (); | 18 |
222 | | - |
223 | if (lreset == 0TRUE | evaluated 19862 times by 1 test | FALSE | evaluated 1398 times by 1 test |
) | 1398-19862 |
224 | line_number--;executed 19862 times by 1 test: line_number--; | 19862 |
225 | | - |
226 | indirection_level++; | - |
227 | | - |
228 | code = should_jump_to_top_level = 0; | - |
229 | last_result = 0; | - |
230 | | - |
231 | | - |
232 | if (current_token == 304TRUE | evaluated 1 time by 1 test | FALSE | evaluated 21259 times by 1 test |
) | 1-21259 |
233 | current_token = '\n';executed 1 time by 1 test: current_token = '\n'; | 1 |
234 | | - |
235 | with_input_from_string (string, from_file); | - |
236 | clear_shell_input_line (); | - |
237 | while (*(TRUE | evaluated 24963 times by 1 test | FALSE | evaluated 19474 times by 1 test |
bash_input.location.string)TRUE | evaluated 24963 times by 1 test | FALSE | evaluated 19474 times by 1 test |
) | 19474-24963 |
238 | { | - |
239 | command = (COMMAND *) | - |
240 | ((void *)0) | - |
241 | ; | - |
242 | | - |
243 | if (interrupt_stateTRUE | never evaluated | FALSE | evaluated 24963 times by 1 test |
) | 0-24963 |
244 | { | - |
245 | last_result = 1; | - |
246 | break; never executed: break; | 0 |
247 | } | - |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | code = | - |
253 | __sigsetjmp ( | - |
254 | (top_level) | - |
255 | , | - |
256 | 0 | - |
257 | ) | - |
258 | ; | - |
259 | | - |
260 | if (codeTRUE | evaluated 66 times by 1 test | FALSE | evaluated 24963 times by 1 test |
) | 66-24963 |
261 | { | - |
262 | should_jump_to_top_level = 0; | - |
263 | switch (code) | - |
264 | { | - |
265 | caseexecuted 14 times by 1 test: case 4: 4:executed 14 times by 1 test: case 4: | 14 |
266 | | - |
267 | | - |
268 | | - |
269 | | - |
270 | | - |
271 | | - |
272 | if (exit_immediately_on_errorTRUE | evaluated 14 times by 1 test | FALSE | never evaluated |
&& variable_contextTRUE | evaluated 1 time by 1 test | FALSE | evaluated 13 times by 1 test |
) | 0-14 |
273 | { | - |
274 | discard_unwind_frame ("pe_dispose"); | - |
275 | variable_context = 0; | - |
276 | }executed 1 time by 1 test: end of block | 1 |
277 | should_jump_to_top_level = 1; | - |
278 | gotoexecuted 14 times by 1 test: goto out; out;executed 14 times by 1 test: goto out; | 14 |
279 | caseexecuted 38 times by 1 test: case 1: 1:executed 38 times by 1 test: case 1: | 38 |
280 | caseexecuted 7 times by 1 test: case 3: 3:executed 7 times by 1 test: case 3: | 7 |
281 | if (commandTRUE | evaluated 45 times by 1 test | FALSE | never evaluated |
) | 0-45 |
282 | run_unwind_frame ("pe_dispose");executed 45 times by 1 test: run_unwind_frame ("pe_dispose"); | 45 |
283 | | - |
284 | | - |
285 | should_jump_to_top_level = 1; | - |
286 | gotoexecuted 45 times by 1 test: goto out; out;executed 45 times by 1 test: goto out; | 45 |
287 | | - |
288 | caseexecuted 7 times by 1 test: case 2: 2:executed 7 times by 1 test: case 2: | 7 |
289 | if (commandTRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
) | 0-7 |
290 | run_unwind_frame ("pe_dispose");executed 7 times by 1 test: run_unwind_frame ("pe_dispose"); | 7 |
291 | last_result = last_command_exit_value = 1; | - |
292 | if (subshell_environmentTRUE | never evaluated | FALSE | evaluated 7 times by 1 test |
) | 0-7 |
293 | { | - |
294 | should_jump_to_top_level = 1; | - |
295 | goto never executed: goto out; out;never executed: goto out; | 0 |
296 | } | - |
297 | else | - |
298 | { | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | sigprocmask ( | - |
304 | 2 | - |
305 | , (sigset_t *)&pe_sigmask, (sigset_t *) | - |
306 | ((void *)0) | - |
307 | ); | - |
308 | | - |
309 | continue;executed 7 times by 1 test: continue; | 7 |
310 | } | - |
311 | | - |
312 | default never executed: default: :never executed: default: | 0 |
313 | command_error ("parse_and_execute", 3, code, 0); | - |
314 | break; never executed: break; | 0 |
315 | } | - |
316 | } | - |
317 | | - |
318 | if (parse_command () == 0TRUE | evaluated 24947 times by 1 test | FALSE | evaluated 16 times by 1 test |
) | 16-24947 |
319 | { | - |
320 | if ((TRUE | never evaluated | FALSE | evaluated 24947 times by 1 test |
flags & 0x020)TRUE | never evaluated | FALSE | evaluated 24947 times by 1 test |
|| (interactive_shell == 0TRUE | evaluated 23240 times by 1 test | FALSE | evaluated 1707 times by 1 test |
&& read_but_dont_executeTRUE | never evaluated | FALSE | evaluated 23240 times by 1 test |
)) | 0-24947 |
321 | { | - |
322 | last_result = 0; | - |
323 | dispose_command (global_command); | - |
324 | global_command = (COMMAND *) | - |
325 | ((void *)0) | - |
326 | ; | - |
327 | } never executed: end of block | 0 |
328 | else if (command = global_commandTRUE | evaluated 22939 times by 1 test | FALSE | evaluated 2008 times by 1 test |
) | 2008-22939 |
329 | { | - |
330 | struct fd_bitmap *bitmap; | - |
331 | | - |
332 | if (flags & 0x080TRUE | evaluated 54 times by 1 test | FALSE | evaluated 22885 times by 1 test |
) | 54-22885 |
333 | { | - |
334 | char *x; | - |
335 | | - |
336 | | - |
337 | | - |
338 | | - |
339 | | - |
340 | | - |
341 | if (command->type != cm_function_defTRUE | evaluated 2 times by 1 test | FALSE | evaluated 52 times by 1 test |
|| | 2-52 |
342 | ((TRUE | evaluated 52 times by 1 test | FALSE | never evaluated |
x = parser_remaining_input ())TRUE | evaluated 52 times by 1 test | FALSE | never evaluated |
&& *TRUE | never evaluated | FALSE | evaluated 52 times by 1 test |
xTRUE | never evaluated | FALSE | evaluated 52 times by 1 test |
) || | 0-52 |
343 | (((TRUE | evaluated 49 times by 1 test | FALSE | evaluated 3 times by 1 test |
from_file)[0] == (command->value.Function_def->name->word)[0]TRUE | evaluated 49 times by 1 test | FALSE | evaluated 3 times by 1 test |
&& TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 3-49 |
344 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
345 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
346 | ) && __builtin_constant_p (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
347 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
348 | ) && (__s1_len = __builtin_strlen (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
349 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
350 | ), __s2_len = __builtin_strlen (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
351 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
352 | ), (!((size_t)(const void *)((TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
353 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
354 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
355 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
356 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
357 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
358 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
359 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
360 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
361 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
362 | , TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
363 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
364 | ) : (__builtin_constant_p (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
365 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
366 | ) && ((size_t)(const void *)((TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
367 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
368 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
369 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
370 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
371 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
372 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
373 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
374 | ) && ((size_t)(const void *)((TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
375 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
376 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
377 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
378 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
379 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
380 | , TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
381 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
382 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
383 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
384 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
385 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
386 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
387 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
388 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
389 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
390 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( from_file ))[3] - __s2[3]); TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
391 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( from_file ))[3] - __s2[3]); | 0-49 |
392 | ))[3] - __s2[3]);TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( from_file ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
| 0-49 |
393 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
394 | ) && ((size_t)(const void *)((TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
395 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
396 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
397 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
398 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
399 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
400 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
401 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
402 | ) && ((size_t)(const void *)((TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
403 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
404 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
405 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
406 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
407 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
408 | , TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
409 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
410 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
411 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
412 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
413 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
414 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
415 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
416 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
417 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
418 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( command->value.Function_def->name->word ))[3] - __s2[3]); TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
419 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( command->value.Function_def->name->word ))[3] - __s2[3]); | 0-49 |
420 | ))[3] - __s2[3]);TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( command->value.Function_def->name->word ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
| 0-49 |
421 | from_fileTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
422 | , TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
423 | command->value.Function_def->name->wordTRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
424 | )))); }) TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
| 0-49 |
425 | == 0TRUE | evaluated 49 times by 1 test | FALSE | never evaluated |
) == 0)TRUE | evaluated 3 times by 1 test | FALSE | evaluated 49 times by 1 test |
) | 0-49 |
426 | { | - |
427 | internal_warning ( | - |
428 | dcgettext (((void *)0), | - |
429 | "%s: ignoring function definition attempt" | - |
430 | , 5) | - |
431 | , from_file); | - |
432 | should_jump_to_top_level = 0; | - |
433 | last_result = last_command_exit_value = 2; | - |
434 | reset_parser (); | - |
435 | break;executed 5 times by 1 test: break; | 5 |
436 | } | - |
437 | }executed 49 times by 1 test: end of block | 49 |
438 | | - |
439 | bitmap = new_fd_bitmap (32); | - |
440 | begin_unwind_frame ("pe_dispose"); | - |
441 | add_unwind_protect (dispose_fd_bitmap, bitmap); | - |
442 | add_unwind_protect (dispose_command, command); | - |
443 | | - |
444 | global_command = (COMMAND *) | - |
445 | ((void *)0) | - |
446 | ; | - |
447 | | - |
448 | if ((TRUE | evaluated 4375 times by 1 test | FALSE | evaluated 18559 times by 1 test |
subshell_environment & 0x04)TRUE | evaluated 4375 times by 1 test | FALSE | evaluated 18559 times by 1 test |
&& comsub_ignore_returnTRUE | evaluated 11 times by 1 test | FALSE | evaluated 4364 times by 1 test |
) | 11-18559 |
449 | command->flags |= 0x08;executed 11 times by 1 test: command->flags |= 0x08; | 11 |
450 | if (should_suppress_fork (command)TRUE | evaluated 328 times by 1 test | FALSE | evaluated 22606 times by 1 test |
) | 328-22606 |
451 | { | - |
452 | command->flags |= 0x40; | - |
453 | command->value.Simple->flags |= 0x40; | - |
454 | }executed 328 times by 1 test: end of block | 328 |
455 | else if (command->type == cm_connectionTRUE | evaluated 11199 times by 1 test | FALSE | evaluated 11407 times by 1 test |
) | 11199-11407 |
456 | optimize_fork (command);executed 11199 times by 1 test: optimize_fork (command); | 11199 |
457 | | - |
458 | | - |
459 | | - |
460 | if (startup_state == 2TRUE | evaluated 3182 times by 1 test | FALSE | evaluated 19752 times by 1 test |
&& | 3182-19752 |
461 | (TRUE | evaluated 2992 times by 1 test | FALSE | evaluated 190 times by 1 test |
subshell_environment & 0x04)TRUE | evaluated 2992 times by 1 test | FALSE | evaluated 190 times by 1 test |
&& | 190-2992 |
462 | *TRUE | evaluated 2973 times by 1 test | FALSE | evaluated 19 times by 1 test |
bash_input.location.string == '\0'TRUE | evaluated 2973 times by 1 test | FALSE | evaluated 19 times by 1 test |
&& | 19-2973 |
463 | command->type == cm_simpleTRUE | evaluated 317 times by 1 test | FALSE | evaluated 2656 times by 1 test |
&& !command->redirectsTRUE | evaluated 317 times by 1 test | FALSE | never evaluated |
&& | 0-2656 |
464 | (TRUE | evaluated 317 times by 1 test | FALSE | never evaluated |
command->flags & 0x80) == 0TRUE | evaluated 317 times by 1 test | FALSE | never evaluated |
&& | 0-317 |
465 | command->value.Simple->words == 0TRUE | evaluated 7 times by 1 test | FALSE | evaluated 310 times by 1 test |
&& | 7-310 |
466 | command->value.Simple->redirectsTRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
&& | 0-7 |
467 | command->value.Simple->redirects->next == 0TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
&& | 0-7 |
468 | command->value.Simple->redirects->instruction == r_input_directionTRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
&& | 0-7 |
469 | command->value.Simple->redirects->redirector.dest == 0TRUE | evaluated 5 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 2-5 |
470 | { | - |
471 | int r; | - |
472 | r = cat_file (command->value.Simple->redirects); | - |
473 | last_result = (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 3 times by 1 test |
r < 0)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 3 times by 1 test |
? 1 : 0; | 2-3 |
474 | }executed 5 times by 1 test: end of block | 5 |
475 | else | - |
476 | last_result = execute_command_internalexecuted 22929 times by 1 test: last_result = execute_command_internal (command, 0, -1, -1, bitmap); | 22929 |
477 | (command, 0, -1, -1, bitmap);executed 22929 times by 1 test: last_result = execute_command_internal (command, 0, -1, -1, bitmap); | 22929 |
478 | dispose_command (command); | - |
479 | dispose_fd_bitmap (bitmap); | - |
480 | discard_unwind_frame ("pe_dispose"); | - |
481 | | - |
482 | if (flags & 0x100TRUE | evaluated 49 times by 1 test | FALSE | evaluated 21162 times by 1 test |
) | 49-21162 |
483 | { | - |
484 | reset_parser (); | - |
485 | break;executed 49 times by 1 test: break; | 49 |
486 | } | - |
487 | }executed 21162 times by 1 test: end of block | 21162 |
488 | }executed 23170 times by 1 test: end of block | 23170 |
489 | else | - |
490 | { | - |
491 | last_result = 1; | - |
492 | | - |
493 | if (interactive_shell == 0TRUE | evaluated 16 times by 1 test | FALSE | never evaluated |
&& this_shell_builtinTRUE | evaluated 4 times by 1 test | FALSE | evaluated 12 times by 1 test |
&& | 0-16 |
494 | (this_shell_builtin == source_builtinTRUE | never evaluated | FALSE | evaluated 4 times by 1 test |
|| this_shell_builtin == eval_builtinTRUE | evaluated 4 times by 1 test | FALSE | never evaluated |
) && | 0-4 |
495 | last_command_exit_value == 257TRUE | evaluated 3 times by 1 test | FALSE | evaluated 1 time by 1 test |
&& posixly_correctTRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
) | 0-3 |
496 | { | - |
497 | should_jump_to_top_level = 1; | - |
498 | code = 4; | - |
499 | last_command_exit_value = 2; | - |
500 | } never executed: end of block | 0 |
501 | | - |
502 | | - |
503 | | - |
504 | break;executed 16 times by 1 test: break; | 16 |
505 | } | - |
506 | } | - |
507 | | - |
508 | out:code before this statement executed 19544 times by 1 test: out: | 19544 |
509 | | - |
510 | run_unwind_frame ("parse_and_execute top"); | - |
511 | | - |
512 | if (interrupt_stateTRUE | never evaluated | FALSE | evaluated 19603 times by 1 test |
&& parse_and_execute_level == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0-19603 |
513 | { | - |
514 | | - |
515 | | - |
516 | | - |
517 | interactive = interactive_shell; | - |
518 | throw_to_top_level (); | - |
519 | } never executed: end of block | 0 |
520 | | - |
521 | if (should_jump_to_top_levelTRUE | evaluated 59 times by 1 test | FALSE | evaluated 19544 times by 1 test |
) | 59-19544 |
522 | jump_to_top_level (code);executed 59 times by 1 test: jump_to_top_level (code); | 59 |
523 | | - |
524 | returnexecuted 19544 times by 1 test: return (last_result); (last_result);executed 19544 times by 1 test: return (last_result); | 19544 |
525 | } | - |
526 | | - |
527 | | - |
528 | | - |
529 | | - |
530 | | - |
531 | | - |
532 | int | - |
533 | parse_string (string, from_file, flags, endp) | - |
534 | char *string; | - |
535 | const char *from_file; | - |
536 | int flags; | - |
537 | char **endp; | - |
538 | { | - |
539 | int code, nc; | - |
540 | volatile int should_jump_to_top_level; | - |
541 | COMMAND *volatile command, *oglobal; | - |
542 | char *ostring; | - |
543 | volatile sigset_t ps_sigmask; | - |
544 | | - |
545 | parse_prologue (string, flags, "parse_string top"); | - |
546 | | - |
547 | | - |
548 | | - |
549 | sigemptyset ((sigset_t *)&ps_sigmask); | - |
550 | sigprocmask ( | - |
551 | 0 | - |
552 | , (sigset_t *) | - |
553 | ((void *)0) | - |
554 | , (sigset_t *)&ps_sigmask); | - |
555 | | - |
556 | | - |
557 | | - |
558 | | - |
559 | | - |
560 | | - |
561 | | - |
562 | push_stream (0); | - |
563 | if (parser_expanding_alias ()TRUE | never evaluated | FALSE | evaluated 705307 times by 1 test |
) | 0-705307 |
564 | | - |
565 | parser_save_alias (); never executed: parser_save_alias (); | 0 |
566 | | - |
567 | code = should_jump_to_top_level = 0; | - |
568 | oglobal = global_command; | - |
569 | ostring = string; | - |
570 | | - |
571 | with_input_from_string (string, from_file); | - |
572 | while (*(TRUE | evaluated 706586 times by 1 test | FALSE | evaluated 11 times by 1 test |
bash_input.location.string)TRUE | evaluated 706586 times by 1 test | FALSE | evaluated 11 times by 1 test |
) | 11-706586 |
573 | { | - |
574 | command = (COMMAND *) | - |
575 | ((void *)0) | - |
576 | ; | - |
577 | code = | - |
578 | __sigsetjmp ( | - |
579 | (top_level) | - |
580 | , | - |
581 | 0 | - |
582 | ) | - |
583 | ; | - |
584 | | - |
585 | if (codeTRUE | never evaluated | FALSE | evaluated 706586 times by 1 test |
) | 0-706586 |
586 | { | - |
587 | | - |
588 | itrace("parse_string: longjmp executed: code = %d", code); | - |
589 | | - |
590 | should_jump_to_top_level = 0; | - |
591 | switch (code) | - |
592 | { | - |
593 | case never executed: case 1: 1:never executed: case 1: | 0 |
594 | case never executed: case 4: 4:never executed: case 4: | 0 |
595 | case never executed: case 3: 3:never executed: case 3: | 0 |
596 | case never executed: case 2: 2:never executed: case 2: | 0 |
597 | if (commandTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
598 | dispose_command (command); never executed: dispose_command (command); | 0 |
599 | | - |
600 | | - |
601 | should_jump_to_top_level = 1; | - |
602 | goto never executed: goto out; out;never executed: goto out; | 0 |
603 | | - |
604 | default never executed: default: :never executed: default: | 0 |
605 | | - |
606 | sigprocmask ( | - |
607 | 2 | - |
608 | , (sigset_t *)&ps_sigmask, (sigset_t *) | - |
609 | ((void *)0) | - |
610 | ); | - |
611 | | - |
612 | command_error ("parse_string", 3, code, 0); | - |
613 | break; never executed: break; | 0 |
614 | } | - |
615 | } | - |
616 | | - |
617 | if (parse_command () == 0TRUE | evaluated 706579 times by 1 test | FALSE | evaluated 7 times by 1 test |
) | 7-706579 |
618 | { | - |
619 | dispose_command (global_command); | - |
620 | global_command = (COMMAND *) | - |
621 | ((void *)0) | - |
622 | ; | - |
623 | }executed 706579 times by 1 test: end of block | 706579 |
624 | else | - |
625 | { | - |
626 | if ((TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
flags & 0x040) == 0TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
) | 0-7 |
627 | { | - |
628 | should_jump_to_top_level = 1; | - |
629 | code = 2; | - |
630 | }executed 7 times by 1 test: end of block | 7 |
631 | else | - |
632 | reset_parser (); never executed: reset_parser (); | 0 |
633 | break;executed 7 times by 1 test: break; | 7 |
634 | } | - |
635 | | - |
636 | if (current_token == 304TRUE | evaluated 961 times by 1 test | FALSE | evaluated 705618 times by 1 test |
|| current_token == shell_eof_tokenTRUE | evaluated 704328 times by 1 test | FALSE | evaluated 1290 times by 1 test |
) | 961-705618 |
637 | break;executed 705289 times by 1 test: break; | 705289 |
638 | }executed 1290 times by 1 test: end of block | 1290 |
639 | | - |
640 | out:code before this statement executed 705307 times by 1 test: out: | 705307 |
641 | | - |
642 | global_command = oglobal; | - |
643 | nc = bash_input.location.string - ostring; | - |
644 | if (endpTRUE | evaluated 705307 times by 1 test | FALSE | never evaluated |
) | 0-705307 |
645 | *executed 705307 times by 1 test: *endp = bash_input.location.string; endp = bash_input.location.string;executed 705307 times by 1 test: *endp = bash_input.location.string; | 705307 |
646 | | - |
647 | run_unwind_frame ("parse_string top"); | - |
648 | | - |
649 | | - |
650 | | - |
651 | if (should_jump_to_top_levelTRUE | evaluated 7 times by 1 test | FALSE | evaluated 705300 times by 1 test |
) | 7-705300 |
652 | { | - |
653 | if (parse_and_execute_level == 0TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
) | 0-7 |
654 | top_level_cleanup ();executed 7 times by 1 test: top_level_cleanup (); | 7 |
655 | if (code == 2TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
) | 0-7 |
656 | returnexecuted 7 times by 1 test: return -2; -2;executed 7 times by 1 test: return -2; | 7 |
657 | jump_to_top_level (code); | - |
658 | } never executed: end of block | 0 |
659 | | - |
660 | returnexecuted 705300 times by 1 test: return (nc); (nc);executed 705300 times by 1 test: return (nc); | 705300 |
661 | } | - |
662 | | - |
663 | | - |
664 | | - |
665 | | - |
666 | static int | - |
667 | cat_file (r) | - |
668 | REDIRECT *r; | - |
669 | { | - |
670 | char *fn; | - |
671 | int fd, rval; | - |
672 | | - |
673 | if (r->instruction != r_input_directionTRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
674 | return never executed: return -1; -1;never executed: return -1; | 0 |
675 | | - |
676 | | - |
677 | if (posixly_correctTRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
&& !interactive_shellTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-4 |
678 | disallow_filename_globbing++;executed 1 time by 1 test: disallow_filename_globbing++; | 1 |
679 | fn = redirection_expand (r->redirectee.filename); | - |
680 | if (posixly_correctTRUE | evaluated 1 time by 1 test | FALSE | evaluated 4 times by 1 test |
&& !interactive_shellTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-4 |
681 | disallow_filename_globbing--;executed 1 time by 1 test: disallow_filename_globbing--; | 1 |
682 | | - |
683 | if (fn == 0TRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-5 |
684 | { | - |
685 | redirection_error (r, -1); | - |
686 | return never executed: return -1; -1;never executed: return -1; | 0 |
687 | } | - |
688 | | - |
689 | fd = open(fn, | - |
690 | 00 | - |
691 | ); | - |
692 | if (fd < 0TRUE | evaluated 2 times by 1 test | FALSE | evaluated 3 times by 1 test |
) | 2-3 |
693 | { | - |
694 | file_error (fn); | - |
695 | sh_xfree((fn), "evalstring.c", 637); | - |
696 | returnexecuted 2 times by 1 test: return -1; -1;executed 2 times by 1 test: return -1; | 2 |
697 | } | - |
698 | | - |
699 | rval = zcatfd (fd, 1, fn); | - |
700 | | - |
701 | sh_xfree((fn), "evalstring.c", 643); | - |
702 | close (fd); | - |
703 | | - |
704 | returnexecuted 3 times by 1 test: return (rval); (rval);executed 3 times by 1 test: return (rval); | 3 |
705 | } | - |
706 | | - |
707 | int | - |
708 | evalstring (string, from_file, flags) | - |
709 | char *string; | - |
710 | const char *from_file; | - |
711 | int flags; | - |
712 | { | - |
713 | volatile int r, rflag, rcatch; | - |
714 | | - |
715 | rcatch = 0; | - |
716 | rflag = return_catch_flag; | - |
717 | | - |
718 | | - |
719 | | - |
720 | if (rflagTRUE | evaluated 6821 times by 1 test | FALSE | evaluated 6393 times by 1 test |
) | 6393-6821 |
721 | { | - |
722 | begin_unwind_frame ("evalstring"); | - |
723 | | - |
724 | unwind_protect_mem ((char *)&(return_catch_flag), sizeof (return_catch_flag)); | - |
725 | unwind_protect_mem ((char *)&(return_catch), sizeof (return_catch)); | - |
726 | | - |
727 | return_catch_flag++; | - |
728 | rcatch = | - |
729 | __sigsetjmp ( | - |
730 | (return_catch) | - |
731 | , | - |
732 | 0 | - |
733 | ) | - |
734 | ; | - |
735 | }executed 6821 times by 1 test: end of block | 6821 |
736 | | - |
737 | if (rcatchTRUE | never evaluated | FALSE | evaluated 13214 times by 1 test |
) | 0-13214 |
738 | { | - |
739 | parse_and_execute_cleanup (); | - |
740 | r = return_catch_value; | - |
741 | } never executed: end of block | 0 |
742 | else | - |
743 | | - |
744 | r = parse_and_execute (string, from_file, flags);executed 13214 times by 1 test: r = parse_and_execute (string, from_file, flags); | 13214 |
745 | | - |
746 | if (rflagTRUE | evaluated 6821 times by 1 test | FALSE | evaluated 6385 times by 1 test |
) | 6385-6821 |
747 | { | - |
748 | run_unwind_frame ("evalstring"); | - |
749 | if (rcatchTRUE | never evaluated | FALSE | evaluated 6821 times by 1 test |
&& return_catch_flagTRUE | never evaluated | FALSE | never evaluated |
) | 0-6821 |
750 | { | - |
751 | return_catch_value = r; | - |
752 | siglongjmp((return_catch), (1)); | - |
753 | } never executed: end of block | 0 |
754 | }executed 6821 times by 1 test: end of block | 6821 |
755 | | - |
756 | returnexecuted 13206 times by 1 test: return (r); (r);executed 13206 times by 1 test: return (r); | 13206 |
757 | } | - |
| | |