Skip to content

Commit 681c53a

Browse files
author
Daniel Kroening
committed
expr2ct::convert_code_assign now builds a temporary expression
1 parent d3e030c commit 681c53a

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
@@ -3015,7 +3015,15 @@ std::string expr2ct::convert_code_assign(
30153015
const code_assignt &src,
30163016
unsigned indent)
30173017
{
3018-
std::string tmp=convert_binary(src, "=", 2, true);
3018+
if(src.operands().size()!=2)
3019+
{
3020+
unsigned precedence;
3021+
return convert_norep(src, precedence);
3022+
}
3023+
3024+
binary_exprt tmp_binary(src.op0(), ID_assign, src.op1());
3025+
3026+
std::string tmp=convert_binary(tmp_binary, "=", 2, true);
30193027

30203028
std::string dest=indent_str(indent)+tmp+";";
30213029

0 commit comments

Comments
 (0)