Skip to content

Commit b5acd04

Browse files
author
Daniel Kroening
committed
expr2ct::convert_code_assign now builds a temporary expression
1 parent 1c879e7 commit b5acd04

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,15 @@ std::string expr2ct::convert_code_assign(
30213021
const code_assignt &src,
30223022
unsigned indent)
30233023
{
3024-
std::string tmp=convert_binary(src, "=", 2, true);
3024+
if(src.operands().size()!=2)
3025+
{
3026+
unsigned precedence;
3027+
return convert_norep(src, precedence);
3028+
}
3029+
3030+
binary_exprt tmp_binary(src.op0(), ID_assign, src.op1());
3031+
3032+
std::string tmp=convert_binary(tmp_binary, "=", 2, true);
30253033

30263034
std::string dest=indent_str(indent)+tmp+";";
30273035

0 commit comments

Comments
 (0)