Skip to content

Commit 44d4e46

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

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
@@ -233,29 +233,28 @@ static assignmentt rewrite_with_to_field_symbols(
233233
assignmentt assignment,
234234
const namespacet &ns)
235235
{
236-
ssa_exprt &lhs_mod = assignment.lhs;
237236
if(use_update)
238237
{
239238
while(assignment.rhs.id() == ID_update &&
240239
to_update_expr(assignment.rhs).designator().size() == 1 &&
241-
(lhs_mod.type().id() == ID_array ||
242-
lhs_mod.type().id() == ID_struct ||
243-
lhs_mod.type().id() == ID_struct_tag))
240+
(assignment.lhs.type().id() == ID_array ||
241+
assignment.lhs.type().id() == ID_struct ||
242+
assignment.lhs.type().id() == ID_struct_tag))
244243
{
245244
exprt field_sensitive_lhs;
246245
const update_exprt &update = to_update_expr(assignment.rhs);
247246
PRECONDITION(update.designator().size() == 1);
248247
const exprt &designator = update.designator().front();
249248

250-
if(lhs_mod.type().id() == ID_array)
249+
if(assignment.lhs.type().id() == ID_array)
251250
{
252251
field_sensitive_lhs =
253-
index_exprt(lhs_mod, to_index_designator(designator).index());
252+
index_exprt(assignment.lhs, to_index_designator(designator).index());
254253
}
255254
else
256255
{
257256
field_sensitive_lhs = member_exprt(
258-
lhs_mod,
257+
assignment.lhs,
259258
to_member_designator(designator).get_component_name(),
260259
update.new_value().type());
261260
}
@@ -266,28 +265,28 @@ static assignmentt rewrite_with_to_field_symbols(
266265
break;
267266

268267
assignment.rhs = update.new_value();
269-
lhs_mod = to_ssa_expr(field_sensitive_lhs);
268+
assignment.lhs = to_ssa_expr(field_sensitive_lhs);
270269
}
271270
}
272271
else
273272
{
274273
while(assignment.rhs.id() == ID_with &&
275274
to_with_expr(assignment.rhs).operands().size() == 3 &&
276-
(lhs_mod.type().id() == ID_array ||
277-
lhs_mod.type().id() == ID_struct ||
278-
lhs_mod.type().id() == ID_struct_tag))
275+
(assignment.lhs.type().id() == ID_array ||
276+
assignment.lhs.type().id() == ID_struct ||
277+
assignment.lhs.type().id() == ID_struct_tag))
279278
{
280279
exprt field_sensitive_lhs;
281280
const with_exprt &with_expr = to_with_expr(assignment.rhs);
282281

283-
if(lhs_mod.type().id() == ID_array)
282+
if(assignment.lhs.type().id() == ID_array)
284283
{
285-
field_sensitive_lhs = index_exprt(lhs_mod, with_expr.where());
284+
field_sensitive_lhs = index_exprt(assignment.lhs, with_expr.where());
286285
}
287286
else
288287
{
289288
field_sensitive_lhs = member_exprt(
290-
lhs_mod,
289+
assignment.lhs,
291290
with_expr.where().get(ID_component_name),
292291
with_expr.new_value().type());
293292
}
@@ -299,7 +298,7 @@ static assignmentt rewrite_with_to_field_symbols(
299298
break;
300299

301300
assignment.rhs = with_expr.new_value();
302-
lhs_mod = to_ssa_expr(field_sensitive_lhs);
301+
assignment.lhs = to_ssa_expr(field_sensitive_lhs);
303302
}
304303
}
305304
return assignment;

0 commit comments

Comments
 (0)