states, stree: update pre_cond, cond_true/false stacks to stree
[smatch.git] / smatch_states.c
blobe13ad44bd1ef9715d66f391afe5df95d73628f20
1 /*
2 * Copyright (C) 2006 Dan Carpenter.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
19 * You have a lists of states. kernel = locked, foo = NULL, ...
20 * When you hit an if {} else {} statement then you swap the list
21 * of states for a different list of states. The lists are stored
22 * on stacks.
24 * At the beginning of this file there are list of the stacks that
25 * we use. Each function in this file does something to one of
26 * of the stacks.
28 * So the smatch_flow.c understands code but it doesn't understand states.
29 * smatch_flow calls functions in this file. This file calls functions
30 * in smatch_slist.c which just has boring generic plumbing for handling
31 * state lists. But really it's this file where all the magic happens.
34 #include <stdlib.h>
35 #include <stdio.h>
36 #include "smatch.h"
37 #include "smatch_slist.h"
38 #include "smatch_extra.h"
40 struct smatch_state undefined = { .name = "undefined" };
41 struct smatch_state merged = { .name = "merged" };
42 struct smatch_state true_state = { .name = "true" };
43 struct smatch_state false_state = { .name = "false" };
45 static struct AVL *cur_stree; /* current states */
47 static struct stree_stack *true_stack; /* states after a t/f branch */
48 static struct stree_stack *false_stack;
49 static struct stree_stack *pre_cond_stack; /* states before a t/f branch */
51 static struct stree_stack *cond_true_stack; /* states affected by a branch */
52 static struct stree_stack *cond_false_stack;
54 static struct stree_stack *fake_cur_stree_stack;
55 static int read_only;
57 static struct stree_stack *break_stack;
58 static struct stree_stack *switch_stack;
59 static struct range_list_stack *remaining_cases;
60 static struct stree_stack *default_stack;
61 static struct stree_stack *continue_stack;
63 static struct named_stree_stack *goto_stack;
65 static struct ptr_list *backup;
67 struct state_list_stack *implied_pools;
69 int option_debug;
71 void __print_cur_slist(void)
73 __print_stree(cur_stree);
76 static int in_declarations_bit(void)
78 struct statement *tmp;
80 FOR_EACH_PTR_REVERSE(big_statement_stack, tmp) {
81 if (tmp->type == STMT_DECLARATION)
82 return 1;
83 return 0;
84 } END_FOR_EACH_PTR_REVERSE(tmp);
85 return 0;
88 int unreachable(void)
90 static int reset_warnings = 1;
92 if (cur_stree) {
93 if (!__inline_fn)
94 reset_warnings = 1;
95 return 0;
98 if (in_declarations_bit())
99 return 1;
101 /* option spammy turns on a noisier version of this */
102 if (reset_warnings && !option_spammy)
103 sm_msg("info: ignoring unreachable code.");
104 if (!__inline_fn)
105 reset_warnings = 0;
106 return 1;
109 struct sm_state *set_state(int owner, const char *name, struct symbol *sym, struct smatch_state *state)
111 struct sm_state *ret;
113 if (!name)
114 return NULL;
116 if (read_only)
117 sm_msg("Smatch Internal Error: cur_stree is read only.");
119 if (option_debug || strcmp(check_name(owner), option_debug_check) == 0) {
120 struct smatch_state *s;
122 s = get_state(owner, name, sym);
123 if (!s)
124 printf("%d new state. name='%s' [%s] %s\n",
125 get_lineno(), name, check_name(owner), show_state(state));
126 else
127 printf("%d state change name='%s' [%s] %s => %s\n",
128 get_lineno(), name, check_name(owner), show_state(s),
129 show_state(state));
132 if (owner != -1 && unreachable())
133 return NULL;
135 if (fake_cur_stree_stack)
136 set_state_stree_stack(&fake_cur_stree_stack, owner, name, sym, state);
138 ret = set_state_stree(&cur_stree, owner, name, sym, state);
140 if (cond_true_stack) {
141 set_state_stree_stack(&cond_true_stack, owner, name, sym, state);
142 set_state_stree_stack(&cond_false_stack, owner, name, sym, state);
144 return ret;
147 struct sm_state *set_state_expr(int owner, struct expression *expr, struct smatch_state *state)
149 char *name;
150 struct symbol *sym;
151 struct sm_state *ret = NULL;
153 expr = strip_expr(expr);
154 name = expr_to_var_sym(expr, &sym);
155 if (!name || !sym)
156 goto free;
157 ret = set_state(owner, name, sym, state);
158 free:
159 free_string(name);
160 return ret;
163 void __push_fake_cur_slist()
165 push_stree(&fake_cur_stree_stack, NULL);
166 __save_pre_cond_states();
169 struct state_list *__pop_fake_cur_slist()
171 __use_pre_cond_states();
172 return stree_to_slist(pop_stree(&fake_cur_stree_stack));
175 void __free_fake_cur_slist()
177 struct AVL *stree;
179 __use_pre_cond_states();
180 stree = pop_stree(&fake_cur_stree_stack);
181 free_stree(&stree);
184 void __set_fake_cur_slist_fast(struct state_list *slist)
186 push_stree(&pre_cond_stack, cur_stree);
187 cur_stree = slist_to_stree(slist);
188 read_only = 1;
191 void __set_fake_cur_stree_fast(struct AVL *stree)
193 push_stree(&pre_cond_stack, cur_stree);
194 cur_stree = stree;
195 read_only = 1;
198 void __pop_fake_cur_slist_fast()
200 cur_stree = pop_stree(&pre_cond_stack);
201 read_only = 0;
204 void __pop_fake_cur_stree_fast()
206 cur_stree = pop_stree(&pre_cond_stack);
207 read_only = 0;
210 void __merge_slist_into_cur(struct state_list *slist)
212 struct sm_state *sm;
213 struct sm_state *orig;
214 struct sm_state *merged;
216 FOR_EACH_PTR(slist, sm) {
217 orig = get_sm_state(sm->owner, sm->name, sm->sym);
218 if (orig)
219 merged = merge_sm_states(orig, sm);
220 else
221 merged = sm;
222 __set_sm(merged);
223 } END_FOR_EACH_PTR(sm);
226 void __set_sm(struct sm_state *sm)
228 if (read_only)
229 sm_msg("Smatch Internal Error: cur_stree is read only.");
231 if (option_debug ||
232 strcmp(check_name(sm->owner), option_debug_check) == 0) {
233 struct smatch_state *s;
235 s = get_state(sm->owner, sm->name, sm->sym);
236 if (!s)
237 printf("%d new state. name='%s' [%s] %s\n",
238 get_lineno(), sm->name, check_name(sm->owner),
239 show_state(sm->state));
240 else
241 printf("%d state change name='%s' [%s] %s => %s\n",
242 get_lineno(), sm->name, check_name(sm->owner), show_state(s),
243 show_state(sm->state));
246 if (unreachable())
247 return;
249 if (fake_cur_stree_stack)
250 overwrite_sm_state_stree_stack(&fake_cur_stree_stack, sm);
252 overwrite_sm_state_stree(&cur_stree, sm);
254 if (cond_true_stack) {
255 overwrite_sm_state_stree_stack(&cond_true_stack, sm);
256 overwrite_sm_state_stree_stack(&cond_false_stack, sm);
260 struct smatch_state *get_state(int owner, const char *name, struct symbol *sym)
262 return get_state_stree(cur_stree, owner, name, sym);
265 struct smatch_state *get_state_expr(int owner, struct expression *expr)
267 char *name;
268 struct symbol *sym;
269 struct smatch_state *ret = NULL;
271 expr = strip_expr(expr);
272 name = expr_to_var_sym(expr, &sym);
273 if (!name || !sym)
274 goto free;
275 ret = get_state(owner, name, sym);
276 free:
277 free_string(name);
278 return ret;
281 struct state_list *get_possible_states(int owner, const char *name, struct symbol *sym)
283 struct sm_state *sms;
285 sms = get_sm_state_stree(cur_stree, owner, name, sym);
286 if (sms)
287 return sms->possible;
288 return NULL;
291 struct state_list *get_possible_states_expr(int owner, struct expression *expr)
293 char *name;
294 struct symbol *sym;
295 struct state_list *ret = NULL;
297 expr = strip_expr(expr);
298 name = expr_to_var_sym(expr, &sym);
299 if (!name || !sym)
300 goto free;
301 ret = get_possible_states(owner, name, sym);
302 free:
303 free_string(name);
304 return ret;
307 struct sm_state *get_sm_state(int owner, const char *name, struct symbol *sym)
309 return get_sm_state_stree(cur_stree, owner, name, sym);
312 struct sm_state *get_sm_state_expr(int owner, struct expression *expr)
314 char *name;
315 struct symbol *sym;
316 struct sm_state *ret = NULL;
318 expr = strip_expr(expr);
319 name = expr_to_var_sym(expr, &sym);
320 if (!name || !sym)
321 goto free;
322 ret = get_sm_state(owner, name, sym);
323 free:
324 free_string(name);
325 return ret;
328 void delete_state(int owner, const char *name, struct symbol *sym)
330 delete_state_stree(&cur_stree, owner, name, sym);
331 if (cond_true_stack) {
332 delete_state_stree_stack(&pre_cond_stack, owner, name, sym);
333 delete_state_stree_stack(&cond_true_stack, owner, name, sym);
334 delete_state_stree_stack(&cond_false_stack, owner, name, sym);
338 void delete_state_expr(int owner, struct expression *expr)
340 char *name;
341 struct symbol *sym;
343 expr = strip_expr(expr);
344 name = expr_to_var_sym(expr, &sym);
345 if (!name || !sym)
346 goto free;
347 delete_state(owner, name, sym);
348 free:
349 free_string(name);
352 struct state_list *get_all_states_slist(int owner, struct state_list *source)
354 struct state_list *slist = NULL;
355 struct sm_state *tmp;
357 FOR_EACH_PTR(source, tmp) {
358 if (tmp->owner == owner)
359 add_ptr_list(&slist, tmp);
360 } END_FOR_EACH_PTR(tmp);
362 return slist;
365 struct state_list *get_all_states(int owner)
367 struct state_list *slist = NULL;
368 struct sm_state *tmp;
370 FOR_EACH_SM(cur_stree, tmp) {
371 if (tmp->owner == owner)
372 add_ptr_list(&slist, tmp);
373 } END_FOR_EACH_SM(tmp);
375 return slist;
378 int is_reachable(void)
380 if (cur_stree)
381 return 1;
382 return 0;
385 struct state_list *__get_cur_slist(void)
387 return stree_to_slist(cur_stree);
390 void set_true_false_states(int owner, const char *name, struct symbol *sym,
391 struct smatch_state *true_state,
392 struct smatch_state *false_state)
394 if (option_debug || strcmp(check_name(owner), option_debug_check) == 0) {
395 struct smatch_state *tmp;
397 tmp = get_state(owner, name, sym);
398 printf("%d set_true_false '%s'. Was %s. Now T:%s F:%s\n",
399 get_lineno(), name, show_state(tmp),
400 show_state(true_state), show_state(false_state));
403 if (unreachable())
404 return;
406 if (!cond_false_stack || !cond_true_stack) {
407 printf("Error: missing true/false stacks\n");
408 return;
411 if (true_state) {
412 set_state_stree(&cur_stree, owner, name, sym, true_state);
413 set_state_stree_stack(&cond_true_stack, owner, name, sym, true_state);
415 if (false_state)
416 set_state_stree_stack(&cond_false_stack, owner, name, sym, false_state);
419 void set_true_false_states_expr(int owner, struct expression *expr,
420 struct smatch_state *true_state,
421 struct smatch_state *false_state)
423 char *name;
424 struct symbol *sym;
426 expr = strip_expr(expr);
427 name = expr_to_var_sym(expr, &sym);
428 if (!name || !sym)
429 goto free;
430 set_true_false_states(owner, name, sym, true_state, false_state);
431 free:
432 free_string(name);
435 void __set_true_false_sm(struct sm_state *true_sm, struct sm_state *false_sm)
437 if (unreachable())
438 return;
440 if (!cond_false_stack || !cond_true_stack) {
441 printf("Error: missing true/false stacks\n");
442 return;
445 if (true_sm) {
446 overwrite_sm_state_stree(&cur_stree, true_sm);
447 overwrite_sm_state_stree_stack(&cond_true_stack, true_sm);
449 if (false_sm)
450 overwrite_sm_state_stree_stack(&cond_false_stack, false_sm);
453 void nullify_path(void)
455 free_stree(&cur_stree);
458 void __match_nullify_path_hook(const char *fn, struct expression *expr,
459 void *unused)
461 nullify_path();
465 * At the start of every function we mark the path
466 * as unnull. That way there is always at least one state
467 * in the cur_stree until nullify_path is called. This
468 * is used in merge_slist() for the first null check.
470 void __unnullify_path(void)
472 set_state(-1, "unnull_path", NULL, &true_state);
475 int __path_is_null(void)
477 if (cur_stree)
478 return 0;
479 return 1;
482 static void check_stack_free(struct state_list_stack **stack)
484 if (*stack) {
485 sm_msg("smatch internal error: stack not empty");
486 free_stack_and_slists(stack);
490 static void check_stree_stack_free(struct stree_stack **stack)
492 if (*stack) {
493 sm_msg("smatch internal error: stack not empty");
494 free_stack_and_strees(stack);
498 void save_all_states(void)
500 __add_ptr_list(&backup, stree_to_slist(cur_stree), 0);
502 __add_ptr_list(&backup, true_stack, 0);
503 __add_ptr_list(&backup, false_stack, 0);
504 __add_ptr_list(&backup, pre_cond_stack, 0);
506 __add_ptr_list(&backup, cond_true_stack, 0);
507 __add_ptr_list(&backup, cond_false_stack, 0);
509 __add_ptr_list(&backup, fake_cur_stree_stack, 0);
511 __add_ptr_list(&backup, break_stack, 0);
512 __add_ptr_list(&backup, switch_stack, 0);
513 __add_ptr_list(&backup, remaining_cases, 0);
514 __add_ptr_list(&backup, default_stack, 0);
515 __add_ptr_list(&backup, continue_stack, 0);
517 __add_ptr_list(&backup, goto_stack, 0);
520 void nullify_all_states(void)
522 /* FIXME: These should call free_stree() */
523 cur_stree = NULL;
525 true_stack = NULL;
526 false_stack = NULL;
527 pre_cond_stack = NULL;
529 cond_true_stack = NULL;
530 cond_false_stack = NULL;
532 fake_cur_stree_stack = NULL;
534 break_stack = NULL;
535 switch_stack = NULL;
536 remaining_cases = NULL;
537 default_stack = NULL;
538 continue_stack = NULL;
540 goto_stack = NULL;
543 static void *pop_backup(void)
545 void *ret;
547 ret = last_ptr_list(backup);
548 delete_ptr_list_last(&backup);
549 return ret;
552 void restore_all_states(void)
554 goto_stack = pop_backup();
556 continue_stack = pop_backup();
557 default_stack = pop_backup();
558 remaining_cases = pop_backup();
559 switch_stack = pop_backup();
560 break_stack = pop_backup();
562 fake_cur_stree_stack = pop_backup();
564 cond_false_stack = pop_backup();
565 cond_true_stack = pop_backup();
567 pre_cond_stack = pop_backup();
568 false_stack = pop_backup();
569 true_stack = pop_backup();
571 cur_stree = slist_to_stree(pop_backup());
574 void clear_all_states(void)
576 struct named_stree *named_stree;
578 nullify_path();
579 check_stree_stack_free(&true_stack);
580 check_stree_stack_free(&false_stack);
581 check_stree_stack_free(&pre_cond_stack);
582 check_stree_stack_free(&cond_true_stack);
583 check_stree_stack_free(&cond_false_stack);
584 check_stree_stack_free(&break_stack);
585 check_stree_stack_free(&switch_stack);
586 check_stree_stack_free(&continue_stack);
587 free_stack_and_slists(&implied_pools);
589 FOR_EACH_PTR(goto_stack, named_stree) {
590 free_stree(&named_stree->stree);
591 } END_FOR_EACH_PTR(named_stree);
592 __free_ptr_list((struct ptr_list **)&goto_stack);
593 free_every_single_sm_state();
596 void __push_cond_stacks(void)
598 push_stree(&cond_true_stack, NULL);
599 push_stree(&cond_false_stack, NULL);
602 struct state_list *__copy_cond_true_states(void)
604 struct AVL *ret;
606 ret = pop_stree(&cond_true_stack);
607 push_stree(&cond_true_stack, clone_stree(ret));
608 return stree_to_slist(ret);
611 struct state_list *__copy_cond_false_states(void)
613 struct AVL *ret;
615 ret = pop_stree(&cond_false_stack);
616 push_stree(&cond_false_stack, clone_stree(ret));
617 return stree_to_slist(ret);
620 struct state_list *__pop_cond_true_stack(void)
622 return stree_to_slist(pop_stree(&cond_true_stack));
625 struct state_list *__pop_cond_false_stack(void)
627 return stree_to_slist(pop_stree(&cond_false_stack));
631 * This combines the pre cond states with either the true or false states.
632 * For example:
633 * a = kmalloc() ; if (a !! foo(a)
634 * In the pre state a is possibly null. In the true state it is non null.
635 * In the false state it is null. Combine the pre and the false to get
636 * that when we call 'foo', 'a' is null.
638 static void __use_cond_stack(struct stree_stack **stack)
640 struct AVL *stree;
642 free_stree(&cur_stree);
644 cur_stree = pop_stree(&pre_cond_stack);
645 push_stree(&pre_cond_stack, clone_stree(cur_stree));
647 stree = pop_stree(stack);
648 overwrite_stree(stree, &cur_stree);
649 push_stree(stack, stree);
652 void __use_pre_cond_states(void)
654 free_stree(&cur_stree);
655 cur_stree = pop_stree(&pre_cond_stack);
658 void __use_cond_true_states(void)
660 __use_cond_stack(&cond_true_stack);
663 void __use_cond_false_states(void)
665 __use_cond_stack(&cond_false_stack);
668 void __negate_cond_stacks(void)
670 struct AVL *old_false, *old_true;
672 __use_cond_stack(&cond_false_stack);
673 old_false = pop_stree(&cond_false_stack);
674 old_true = pop_stree(&cond_true_stack);
675 push_stree(&cond_false_stack, old_true);
676 push_stree(&cond_true_stack, old_false);
679 void __and_cond_states(void)
681 and_stree_stack(&cond_true_stack);
682 or_stree_stack(&pre_cond_stack, cur_stree, &cond_false_stack);
685 void __or_cond_states(void)
687 or_stree_stack(&pre_cond_stack, cur_stree, &cond_true_stack);
688 and_stree_stack(&cond_false_stack);
691 void __save_pre_cond_states(void)
693 push_stree(&pre_cond_stack, clone_stree(cur_stree));
696 void __discard_pre_cond_states(void)
698 struct AVL *tmp;
700 tmp = pop_stree(&pre_cond_stack);
701 free_stree(&tmp);
704 void __use_cond_states(void)
706 struct AVL *pre, *pre_clone, *true_states, *false_states;
708 pre = pop_stree(&pre_cond_stack);
709 pre_clone = clone_stree(pre);
711 true_states = pop_stree(&cond_true_stack);
712 overwrite_stree(true_states, &pre);
713 /* we use the true states right away */
714 free_stree(&cur_stree);
715 cur_stree = pre;
717 false_states = pop_stree(&cond_false_stack);
718 overwrite_stree(false_states, &pre_clone);
719 push_stree(&false_stack, pre_clone);
722 void __push_true_states(void)
724 push_stree(&true_stack, clone_stree(cur_stree));
727 void __use_false_states(void)
729 free_stree(&cur_stree);
730 cur_stree = pop_stree(&false_stack);
733 void __discard_false_states(void)
735 struct AVL *stree;
737 stree = pop_stree(&false_stack);
738 free_stree(&stree);
741 void __merge_false_states(void)
743 struct AVL *stree;
745 stree = pop_stree(&false_stack);
746 merge_stree(&cur_stree, stree);
747 free_stree(&stree);
750 void __merge_true_states(void)
752 struct AVL *stree;
754 stree = pop_stree(&true_stack);
755 merge_stree(&cur_stree, stree);
756 free_stree(&stree);
759 void __push_continues(void)
761 push_stree(&continue_stack, NULL);
764 void __discard_continues(void)
766 struct AVL *stree;
768 stree = pop_stree(&continue_stack);
769 free_stree(&stree);
772 void __process_continues(void)
774 struct AVL *stree;
776 stree = pop_stree(&continue_stack);
777 if (!stree)
778 stree = clone_stree(cur_stree);
779 else
780 merge_stree(&stree, cur_stree);
782 push_stree(&continue_stack, stree);
785 static int top_stree_empty(struct stree_stack **stack)
787 struct AVL *tmp;
788 int empty = 0;
790 tmp = pop_stree(stack);
791 if (!tmp)
792 empty = 1;
793 push_stree(stack, tmp);
794 return empty;
797 /* a silly loop does this: while(i--) { return; } */
798 void __warn_on_silly_pre_loops(void)
800 if (!__path_is_null())
801 return;
802 if (!top_stree_empty(&continue_stack))
803 return;
804 if (!top_stree_empty(&break_stack))
805 return;
806 /* if the path was nullified before the loop, then we already
807 printed an error earlier */
808 if (top_stree_empty(&false_stack))
809 return;
810 sm_msg("info: loop could be replaced with if statement.");
813 void __merge_continues(void)
815 struct AVL *stree;
817 stree = pop_stree(&continue_stack);
818 merge_stree(&cur_stree, stree);
819 free_stree(&stree);
822 void __push_breaks(void)
824 push_stree(&break_stack, NULL);
827 void __process_breaks(void)
829 struct AVL *stree;
831 stree = pop_stree(&break_stack);
832 if (!stree)
833 stree = clone_stree(cur_stree);
834 else
835 merge_stree(&stree, cur_stree);
837 push_stree(&break_stack, stree);
840 int __has_breaks(void)
842 struct AVL *stree;
843 int ret;
845 stree = pop_stree(&break_stack);
846 ret = !!stree;
847 push_stree(&break_stack, stree);
848 return ret;
851 void __merge_breaks(void)
853 struct AVL *stree;
855 stree = pop_stree(&break_stack);
856 merge_stree(&cur_stree, stree);
857 free_stree(&stree);
860 void __use_breaks(void)
862 free_stree(&cur_stree);
863 cur_stree = pop_stree(&break_stack);
866 void __save_switch_states(struct expression *switch_expr)
868 push_rl(&remaining_cases, __get_implied_values(switch_expr));
869 push_stree(&switch_stack, clone_stree(cur_stree));
872 void __merge_switches(struct expression *switch_expr, struct expression *case_expr)
874 struct AVL *stree;
875 struct state_list *implied_slist;
877 stree = pop_stree(&switch_stack);
878 implied_slist = __implied_case_slist(switch_expr, case_expr, &remaining_cases, &stree);
879 merge_stree(&cur_stree, slist_to_stree(implied_slist));
880 free_slist(&implied_slist);
881 push_stree(&switch_stack, stree);
884 void __discard_switches(void)
886 struct AVL *stree;
888 pop_rl(&remaining_cases);
889 stree = pop_stree(&switch_stack);
890 free_stree(&stree);
893 void __push_default(void)
895 push_stree(&default_stack, NULL);
898 void __set_default(void)
900 set_state_stree_stack(&default_stack, 0, "has_default", NULL, &true_state);
903 int __pop_default(void)
905 struct AVL *stree;
907 stree = pop_stree(&default_stack);
908 if (stree) {
909 free_stree(&stree);
910 return 1;
912 return 0;
915 static struct named_stree *alloc_named_stree(const char *name, struct AVL *stree)
917 struct named_stree *named_stree = __alloc_named_stree(0);
919 named_stree->name = (char *)name;
920 named_stree->stree = stree;
921 return named_stree;
924 void __save_gotos(const char *name)
926 struct AVL **stree;
927 struct AVL *clone;
929 stree = get_named_stree(goto_stack, name);
930 if (stree) {
931 merge_stree(stree, cur_stree);
932 return;
933 } else {
934 struct named_stree *named_stree;
936 clone = clone_stree(cur_stree);
937 named_stree = alloc_named_stree(name, clone);
938 add_ptr_list(&goto_stack, named_stree);
942 void __merge_gotos(const char *name)
944 struct AVL **stree;
946 stree = get_named_stree(goto_stack, name);
947 if (stree)
948 merge_stree(&cur_stree, *stree);