Skip to content

Commit 8985382

Browse files
Remove definition of useless reference
It is confusing to have two names to refer to the same thing.
1 parent f444dbf commit 8985382

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/goto-symex/symex_assign.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,29 +166,28 @@ static assignmentt rewrite_with_to_field_symbols(
166166
assignmentt assignment,
167167
const namespacet &ns)
168168
{
169-
ssa_exprt &lhs_mod = assignment.lhs;
170169
if(use_update)
171170
{
172171
while(assignment.rhs.id() == ID_update &&
173172
to_update_expr(assignment.rhs).designator().size() == 1 &&
174-
(lhs_mod.type().id() == ID_array ||
175-
lhs_mod.type().id() == ID_struct ||
176-
lhs_mod.type().id() == ID_struct_tag))
173+
(assignment.lhs.type().id() == ID_array ||
174+
assignment.lhs.type().id() == ID_struct ||
175+
assignment.lhs.type().id() == ID_struct_tag))
177176
{
178177
exprt field_sensitive_lhs;
179178
const update_exprt &update = to_update_expr(assignment.rhs);
180179
PRECONDITION(update.designator().size() == 1);
181180
const exprt &designator = update.designator().front();
182181

183-
if(lhs_mod.type().id() == ID_array)
182+
if(assignment.lhs.type().id() == ID_array)
184183
{
185184
field_sensitive_lhs =
186-
index_exprt(lhs_mod, to_index_designator(designator).index());
185+
index_exprt(assignment.lhs, to_index_designator(designator).index());
187186
}
188187
else
189188
{
190189
field_sensitive_lhs = member_exprt(
191-
lhs_mod,
190+
assignment.lhs,
192191
to_member_designator(designator).get_component_name(),
193192
update.new_value().type());
194193
}
@@ -199,28 +198,28 @@ static assignmentt rewrite_with_to_field_symbols(
199198
break;
200199

201200
assignment.rhs = update.new_value();
202-
lhs_mod = to_ssa_expr(field_sensitive_lhs);
201+
assignment.lhs = to_ssa_expr(field_sensitive_lhs);
203202
}
204203
}
205204
else
206205
{
207206
while(assignment.rhs.id() == ID_with &&
208207
to_with_expr(assignment.rhs).operands().size() == 3 &&
209-
(lhs_mod.type().id() == ID_array ||
210-
lhs_mod.type().id() == ID_struct ||
211-
lhs_mod.type().id() == ID_struct_tag))
208+
(assignment.lhs.type().id() == ID_array ||
209+
assignment.lhs.type().id() == ID_struct ||
210+
assignment.lhs.type().id() == ID_struct_tag))
212211
{
213212
exprt field_sensitive_lhs;
214213
const with_exprt &with_expr = to_with_expr(assignment.rhs);
215214

216-
if(lhs_mod.type().id() == ID_array)
215+
if(assignment.lhs.type().id() == ID_array)
217216
{
218-
field_sensitive_lhs = index_exprt(lhs_mod, with_expr.where());
217+
field_sensitive_lhs = index_exprt(assignment.lhs, with_expr.where());
219218
}
220219
else
221220
{
222221
field_sensitive_lhs = member_exprt(
223-
lhs_mod,
222+
assignment.lhs,
224223
with_expr.where().get(ID_component_name),
225224
with_expr.new_value().type());
226225
}
@@ -232,7 +231,7 @@ static assignmentt rewrite_with_to_field_symbols(
232231
break;
233232

234233
assignment.rhs = with_expr.new_value();
235-
lhs_mod = to_ssa_expr(field_sensitive_lhs);
234+
assignment.lhs = to_ssa_expr(field_sensitive_lhs);
236235
}
237236
}
238237
return assignment;

0 commit comments

Comments
 (0)