Skip to content

Commit 716eef1

Browse files
committed
allow multiple assigns clauses
This changes the parser to allow multiple assigns clauses in a contract. The meaning of multiple clauses is the same as the meaning of one clause that contains the concatenation of the target lists of the given clauses.
1 parent 10ddca0 commit 716eef1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/ansi-c/ansi_c_convert_type.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,8 @@ void ansi_c_convert_typet::read_rec(const typet &type)
252252
{
253253
const exprt &as_expr =
254254
static_cast<const exprt &>(static_cast<const irept &>(type));
255-
assigns = to_unary_expr(as_expr).op();
256255

257-
for(const exprt &operand : assigns.operands())
256+
for(const exprt &operand : to_unary_expr(as_expr).op().operands())
258257
{
259258
if(
260259
operand.id() != ID_symbol && operand.id() != ID_ptrmember &&
@@ -265,6 +264,14 @@ void ansi_c_convert_typet::read_rec(const typet &type)
265264
throw 0;
266265
}
267266
}
267+
268+
if(assigns.is_nil())
269+
assigns = to_unary_expr(as_expr).op();
270+
else
271+
{
272+
for(auto &assignment : to_unary_expr(as_expr).op().operands())
273+
assigns.add_to_operands(std::move(assignment));
274+
}
268275
}
269276
else if(type.id() == ID_C_spec_ensures)
270277
{

0 commit comments

Comments
 (0)