Print this page
12724 update smatch to 0.6.1-rc1-il-5
@@ -54,10 +54,13 @@
estate_set_capped(tmp);
if (estate_treat_untagged(s1) && estate_treat_untagged(s2))
estate_set_treat_untagged(tmp);
+ if (estate_new(s1) || estate_new(s2))
+ estate_set_new(tmp);
+
return tmp;
}
struct data_info *get_dinfo(struct smatch_state *state)
{
@@ -124,10 +127,13 @@
return get_dinfo(state)->hard_max;
}
void estate_set_hard_max(struct smatch_state *state)
{
+ /* pointers don't have a hard max */
+ if (is_ptr_type(estate_type(state)))
+ return;
get_dinfo(state)->hard_max = 1;
}
void estate_clear_hard_max(struct smatch_state *state)
{
@@ -172,10 +178,22 @@
void estate_set_treat_untagged(struct smatch_state *state)
{
get_dinfo(state)->treat_untagged = true;
}
+bool estate_new(struct smatch_state *state)
+{
+ if (!estate_rl(state))
+ return false;
+ return get_dinfo(state)->set;
+}
+
+void estate_set_new(struct smatch_state *state)
+{
+ get_dinfo(state)->set = true;
+}
+
sval_t estate_min(struct smatch_state *state)
{
return rl_min(estate_rl(state));
}
@@ -224,10 +242,14 @@
return 0;
if (estate_capped(one) != estate_capped(two))
return 0;
if (estate_treat_untagged(one) != estate_treat_untagged(two))
return 0;
+ if (estate_has_hard_max(one) != estate_has_hard_max(two))
+ return 0;
+ if (estate_new(one) != estate_new(two))
+ return 0;
if (strcmp(one->name, two->name) == 0)
return 1;
return 0;
}