Skip to content

Commit b148154

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

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
@@ -224,29 +224,28 @@ static assignmentt rewrite_with_to_field_symbols(
224224
assignmentt assignment,
225225
const namespacet &ns)
226226
{
227-
ssa_exprt &lhs_mod = assignment.lhs;
228227
if(use_update)
229228
{
230229
while(assignment.rhs.id() == ID_update &&
231230
to_update_expr(assignment.rhs).designator().size() == 1 &&
232-
(lhs_mod.type().id() == ID_array ||
233-
lhs_mod.type().id() == ID_struct ||
234-
lhs_mod.type().id() == ID_struct_tag))
231+
(assignment.lhs.type().id() == ID_array ||
232+
assignment.lhs.type().id() == ID_struct ||
233+
assignment.lhs.type().id() == ID_struct_tag))
235234
{
236235
exprt field_sensitive_lhs;
237236
const update_exprt &update = to_update_expr(assignment.rhs);
238237
PRECONDITION(update.designator().size() == 1);
239238
const exprt &designator = update.designator().front();
240239

241-
if(lhs_mod.type().id() == ID_array)
240+
if(assignment.lhs.type().id() == ID_array)
242241
{
243242
field_sensitive_lhs =
244-
index_exprt(lhs_mod, to_index_designator(designator).index());
243+
index_exprt(assignment.lhs, to_index_designator(designator).index());
245244
}
246245
else
247246
{
248247
field_sensitive_lhs = member_exprt(
249-
lhs_mod,
248+
assignment.lhs,
250249
to_member_designator(designator).get_component_name(),
251250
update.new_value().type());
252251
}
@@ -257,28 +256,28 @@ static assignmentt rewrite_with_to_field_symbols(
257256
break;
258257

259258
assignment.rhs = update.new_value();
260-
lhs_mod = to_ssa_expr(field_sensitive_lhs);
259+
assignment.lhs = to_ssa_expr(field_sensitive_lhs);
261260
}
262261
}
263262
else
264263
{
265264
while(assignment.rhs.id() == ID_with &&
266265
to_with_expr(assignment.rhs).operands().size() == 3 &&
267-
(lhs_mod.type().id() == ID_array ||
268-
lhs_mod.type().id() == ID_struct ||
269-
lhs_mod.type().id() == ID_struct_tag))
266+
(assignment.lhs.type().id() == ID_array ||
267+
assignment.lhs.type().id() == ID_struct ||
268+
assignment.lhs.type().id() == ID_struct_tag))
270269
{
271270
exprt field_sensitive_lhs;
272271
const with_exprt &with_expr = to_with_expr(assignment.rhs);
273272

274-
if(lhs_mod.type().id() == ID_array)
273+
if(assignment.lhs.type().id() == ID_array)
275274
{
276-
field_sensitive_lhs = index_exprt(lhs_mod, with_expr.where());
275+
field_sensitive_lhs = index_exprt(assignment.lhs, with_expr.where());
277276
}
278277
else
279278
{
280279
field_sensitive_lhs = member_exprt(
281-
lhs_mod,
280+
assignment.lhs,
282281
with_expr.where().get(ID_component_name),
283282
with_expr.new_value().type());
284283
}
@@ -290,7 +289,7 @@ static assignmentt rewrite_with_to_field_symbols(
290289
break;
291290

292291
assignment.rhs = with_expr.new_value();
293-
lhs_mod = to_ssa_expr(field_sensitive_lhs);
292+
assignment.lhs = to_ssa_expr(field_sensitive_lhs);
294293
}
295294
}
296295
return assignment;

0 commit comments

Comments
 (0)