Skip to content

Commit 6f1db4a

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

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

src/pointer-analysis/value_set_fi.cpp

Lines changed: 13 additions & 16 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
}
@@ -1279,12 +1279,9 @@ void value_set_fit::assign_rec(
12791279

12801280
const typet &type=ns.follow(lhs.op0().type());
12811281

1282-
DATA_INVARIANT(type.id()==ID_array ||
1283-
type.id()==ID_incomplete_array ||
1284-
type.id()=="#REF#",
1285-
"operand 0 of index expression must be an array");
1286-
1287-
assign_rec(lhs.op0(), values_rhs, "[]"+suffix, ns, recursion_set);
1282+
if(type.id()==ID_array ||
1283+
type.id()==ID_incomplete_array)
1284+
assign_rec(lhs.op0(), values_rhs, "[]"+suffix, ns, recursion_set);
12881285
}
12891286
else if(lhs.id()==ID_member)
12901287
{
@@ -1328,9 +1325,9 @@ void value_set_fit::assign_rec(
13281325

13291326
assign_rec(typecast_expr.op(), values_rhs, suffix, ns, recursion_set);
13301327
}
1331-
else if(lhs.id()=="zero_string" ||
1332-
lhs.id()=="is_zero_string" ||
1333-
lhs.id()=="zero_string_length")
1328+
else if(
1329+
lhs.id() == "zero_string" || lhs.id() == "is_zero_string" ||
1330+
lhs.id() == "zero_string_length" || lhs.id() == ID_address_of)
13341331
{
13351332
// ignore
13361333
}

0 commit comments

Comments
 (0)