@@ -296,13 +296,11 @@ void string_instrumentationt::do_sprintf(
296
296
297
297
if (call.lhs ().is_not_nil ())
298
298
{
299
- goto_programt::targett return_assignment=tmp.add_instruction (ASSIGN);
300
- return_assignment->source_location =target->source_location ;
301
-
302
299
exprt rhs =
303
300
side_effect_expr_nondett (call.lhs ().type (), target->source_location );
304
301
305
- return_assignment->code =code_assignt (call.lhs (), rhs);
302
+ tmp.add (
303
+ goto_programt::make_assignment (call.lhs (), rhs, target->source_location ));
306
304
}
307
305
308
306
target->turn_into_skip ();
@@ -337,13 +335,11 @@ void string_instrumentationt::do_snprintf(
337
335
338
336
if (call.lhs ().is_not_nil ())
339
337
{
340
- goto_programt::targett return_assignment=tmp.add_instruction (ASSIGN);
341
- return_assignment->source_location =target->source_location ;
342
-
343
338
exprt rhs =
344
339
side_effect_expr_nondett (call.lhs ().type (), target->source_location );
345
340
346
- return_assignment->code =code_assignt (call.lhs (), rhs);
341
+ tmp.add (
342
+ goto_programt::make_assignment (call.lhs (), rhs, target->source_location ));
347
343
}
348
344
349
345
target->turn_into_skip ();
@@ -369,13 +365,11 @@ void string_instrumentationt::do_fscanf(
369
365
370
366
if (call.lhs ().is_not_nil ())
371
367
{
372
- goto_programt::targett return_assignment=tmp.add_instruction (ASSIGN);
373
- return_assignment->source_location =target->source_location ;
374
-
375
368
exprt rhs =
376
369
side_effect_expr_nondett (call.lhs ().type (), target->source_location );
377
370
378
- return_assignment->code =code_assignt (call.lhs (), rhs);
371
+ tmp.add (
372
+ goto_programt::make_assignment (call.lhs (), rhs, target->source_location ));
379
373
}
380
374
381
375
target->turn_into_skip ();
@@ -560,14 +554,12 @@ void string_instrumentationt::do_format_string_write(
560
554
const exprt &argument=arguments[argument_start_inx+args];
561
555
const typet &arg_type = argument.type ();
562
556
563
- goto_programt::targett assignment=dest.add_instruction (ASSIGN);
564
- assignment->source_location =target->source_location ;
565
-
566
557
const dereference_exprt lhs (argument, arg_type.subtype ());
567
558
568
559
side_effect_expr_nondett rhs (lhs.type (), target->source_location );
569
560
570
- assignment->code =code_assignt (lhs, rhs);
561
+ dest.add (
562
+ goto_programt::make_assignment (lhs, rhs, target->source_location ));
571
563
572
564
args++;
573
565
break ;
@@ -602,14 +594,12 @@ void string_instrumentationt::do_format_string_write(
602
594
}
603
595
else
604
596
{
605
- goto_programt::targett assignment=dest.add_instruction (ASSIGN);
606
- assignment->source_location =target->source_location ;
607
-
608
597
dereference_exprt lhs (arguments[i], arg_type.subtype ());
609
598
610
599
side_effect_expr_nondett rhs (lhs.type (), target->source_location );
611
600
612
- assignment->code =code_assignt (lhs, rhs);
601
+ dest.add (
602
+ goto_programt::make_assignment (lhs, rhs, target->source_location ));
613
603
}
614
604
}
615
605
}
@@ -804,11 +794,8 @@ void string_instrumentationt::do_strerror(
804
794
address_of_exprt ptr (index);
805
795
806
796
// make that zero-terminated
807
- {
808
- goto_programt::targett assignment2=tmp.add_instruction (ASSIGN);
809
- assignment2->code =code_assignt (is_zero_string (ptr, true ), true_exprt ());
810
- assignment2->source_location =it->source_location ;
811
- }
797
+ tmp.add (goto_programt::make_assignment (
798
+ is_zero_string (ptr, true ), true_exprt (), it->source_location ));
812
799
813
800
// assign address
814
801
{
@@ -851,23 +838,21 @@ void string_instrumentationt::invalidate_buffer(
851
838
// create a loop that runs over the buffer
852
839
// and invalidates every element
853
840
854
- goto_programt::targett init=dest. add_instruction (ASSIGN);
855
- init-> source_location =target-> source_location ;
856
- init-> code =
857
- code_assignt (cntr_sym. symbol_expr (), from_integer ( 0 , cntr_sym. type ));
841
+ dest. add ( goto_programt::make_assignment (
842
+ cntr_sym. symbol_expr (),
843
+ from_integer ( 0 , cntr_sym. type ),
844
+ target-> source_location ));
858
845
859
846
goto_programt::targett check=dest.add_instruction ();
860
847
861
848
goto_programt::targett invalidate=dest.add_instruction (ASSIGN);
862
849
invalidate->source_location =target->source_location ;
863
850
864
- goto_programt::targett increment=dest.add_instruction (ASSIGN);
865
- increment->source_location =target->source_location ;
866
-
867
851
const plus_exprt plus (
868
852
cntr_sym.symbol_expr (), from_integer (1 , unsigned_int_type ()));
869
853
870
- increment->code =code_assignt (cntr_sym.symbol_expr (), plus);
854
+ dest.add (goto_programt::make_assignment (
855
+ cntr_sym.symbol_expr (), plus, target->source_location ));
871
856
872
857
dest.add (
873
858
goto_programt::make_goto (check, true_exprt (), target->source_location ));
0 commit comments