Skip to content

Commit a10558e

Browse files
author
Daniel Kroening
committed
tolerate two cases of imprecision in value_set_fi; addresses issue #2653
1 parent 097cf71 commit a10558e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/pointer-analysis/value_set_fi.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,13 @@ void value_set_fit::get_value_set_rec(
409409

410410
const typet &type=ns.follow(expr.op0().type());
411411

412-
DATA_INVARIANT(type.id()==ID_array ||
413-
type.id()==ID_incomplete_array ||
414-
type.id()=="#REF#",
415-
"operand 0 of index expression must be an array");
416-
417-
get_value_set_rec(expr.op0(), dest, "[]"+suffix,
418-
original_type, ns, recursion_set);
412+
if(type.id() == ID_array)
413+
{
414+
get_value_set_rec(
415+
expr.op0(), dest, "[]" + suffix, original_type, ns, recursion_set);
416+
}
417+
else
418+
insert(dest, exprt(ID_unknown, original_type));
419419

420420
return;
421421
}
@@ -1328,9 +1328,9 @@ void value_set_fit::assign_rec(
13281328

13291329
assign_rec(typecast_expr.op(), values_rhs, suffix, ns, recursion_set);
13301330
}
1331-
else if(lhs.id()=="zero_string" ||
1332-
lhs.id()=="is_zero_string" ||
1333-
lhs.id()=="zero_string_length")
1331+
else if(
1332+
lhs.id() == "zero_string" || lhs.id() == "is_zero_string" ||
1333+
lhs.id() == "zero_string_length" || lhs.id() == ID_address_of)
13341334
{
13351335
// ignore
13361336
}

0 commit comments

Comments
 (0)