Print this page
11506 smatch resync

@@ -82,20 +82,20 @@
 
 struct sm_state *set_state(int owner, const char *name, struct symbol *sym, struct smatch_state *state)
 {
         struct sm_state *ret;
 
-        if (!name)
+        if (!name || !state)
                 return NULL;
 
         if (read_only)
                 sm_perror("cur_stree is read only.");
 
         if (option_debug || strcmp(check_name(owner), option_debug_check) == 0) {
                 struct smatch_state *s;
 
-                s = get_state(owner, name, sym);
+                s = __get_state(owner, name, sym);
                 if (!s)
                         sm_msg("%s new [%s] '%s' %s", __func__,
                                check_name(owner), name, show_state(state));
                 else
                         sm_msg("%s change [%s] '%s' %s => %s",

@@ -194,11 +194,11 @@
 
         if (option_debug ||
             strcmp(check_name(sm->owner), option_debug_check) == 0) {
                 struct smatch_state *s;
 
-                s = get_state(sm->owner, sm->name, sm->sym);
+                s = __get_state(sm->owner, sm->name, sm->sym);
                 if (!s)
                         sm_msg("%s new %s", __func__, show_sm(sm));
                 else
                         sm_msg("%s change %s (was %s)", __func__, show_sm(sm),
                                show_state(s));

@@ -220,11 +220,11 @@
 
         if (option_debug ||
             strcmp(check_name(sm->owner), option_debug_check) == 0) {
                 struct smatch_state *s;
 
-                s = get_state(sm->owner, sm->name, sm->sym);
+                s = __get_state(sm->owner, sm->name, sm->sym);
                 if (!s)
                         sm_msg("%s new %s", __func__, show_sm(sm));
                 else
                         sm_msg("%s change %s (was %s)",
                                 __func__, show_sm(sm), show_state(s));

@@ -243,11 +243,11 @@
 
         if (option_debug ||
             strcmp(check_name(sm->owner), option_debug_check) == 0) {
                 struct smatch_state *s;
 
-                s = get_state(sm->owner, sm->name, sm->sym);
+                s = __get_state(sm->owner, sm->name, sm->sym);
                 if (!s)
                         sm_msg("%s new %s", __func__, show_sm(sm));
                 else
                         sm_msg("%s change %s (was %s)",
                                 __func__, show_sm(sm), show_state(s));

@@ -475,11 +475,11 @@
                 sm_perror("cur_stree is read only.");
 
         if (option_debug || strcmp(check_name(owner), option_debug_check) == 0) {
                 struct smatch_state *tmp;
 
-                tmp = get_state(owner, name, sym);
+                tmp = __get_state(owner, name, sym);
                 sm_msg("%s [%s] '%s'.  Was %s.  Now T:%s F:%s", __func__,
                        check_name(owner),  name, show_state(tmp),
                        show_state(true_state), show_state(false_state));
         }
 

@@ -529,11 +529,11 @@
         name = true_sm ? true_sm->name : false_sm->name;
         sym = true_sm ? true_sm->sym : false_sm->sym;
         if (option_debug || strcmp(check_name(owner), option_debug_check) == 0) {
                 struct smatch_state *tmp;
 
-                tmp = get_state(owner, name, sym);
+                tmp = __get_state(owner, name, sym);
                 sm_msg("%s [%s] '%s'.  Was %s.  Now T:%s F:%s", __func__,
                        check_name(owner),  name, show_state(tmp),
                        show_state(true_sm ? true_sm->state : NULL),
                        show_state(false_sm ? false_sm->state : NULL));
         }

@@ -787,11 +787,10 @@
 
 void __negate_cond_stacks(void)
 {
         struct stree *old_false, *old_true;
 
-        __use_cond_stack(&cond_false_stack);
         old_false = pop_stree(&cond_false_stack);
         old_true = pop_stree(&cond_true_stack);
         push_stree(&cond_false_stack, old_true);
         push_stree(&cond_true_stack, old_false);
 }