Skip to content

Commit 1ecf63c

Browse files
author
Daniel Kroening
committed
expr2ct::convert_code_assign now builds a temporary expression
1 parent 715d67c commit 1ecf63c

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

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

0 commit comments

Comments
 (0)