Print this page
11506 smatch resync


  85 }
  86 
  87 static void match_link_modify(struct sm_state *sm, struct expression *mod_expr)
  88 {
  89         struct var_sym_list *links;
  90         struct var_sym *tmp;
  91 
  92         links = sm->state->data;
  93 
  94         FOR_EACH_PTR(links, tmp) {
  95                 set_state(sm->owner - 1, tmp->var, tmp->sym, &undefined);
  96         } END_FOR_EACH_PTR(tmp);
  97         set_state(sm->owner, sm->name, sm->sym, &undefined);
  98 }
  99 
 100 void set_up_link_functions(int id, int link_id)
 101 {
 102         if (id + 1 != link_id)
 103                 sm_fatal("FATAL ERROR: links need to be registered directly after the check");
 104 

 105         add_merge_hook(link_id, &merge_link_states);
 106         add_modification_hook(link_id, &match_link_modify);
 107         // free link at the end of function
 108 }
 109 


  85 }
  86 
  87 static void match_link_modify(struct sm_state *sm, struct expression *mod_expr)
  88 {
  89         struct var_sym_list *links;
  90         struct var_sym *tmp;
  91 
  92         links = sm->state->data;
  93 
  94         FOR_EACH_PTR(links, tmp) {
  95                 set_state(sm->owner - 1, tmp->var, tmp->sym, &undefined);
  96         } END_FOR_EACH_PTR(tmp);
  97         set_state(sm->owner, sm->name, sm->sym, &undefined);
  98 }
  99 
 100 void set_up_link_functions(int id, int link_id)
 101 {
 102         if (id + 1 != link_id)
 103                 sm_fatal("FATAL ERROR: links need to be registered directly after the check");
 104 
 105         set_dynamic_states(link_id);
 106         add_merge_hook(link_id, &merge_link_states);
 107         add_modification_hook(link_id, &match_link_modify);
 108         // free link at the end of function
 109 }
 110