@@ -256,16 +256,12 @@ void dfcc_instrumentt::instrument_harness_function(
256256 // create a local write set symbol
257257 const auto &function_symbol =
258258 dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id);
259- const auto &write_set = dfcc_utilst::create_symbol (
260- goto_model.symbol_table ,
261- library.dfcc_type [dfcc_typet::WRITE_SET_PTR],
262- function_id,
263- " __write_set_to_check" ,
264- function_symbol.location ,
265- function_symbol.mode ,
266- function_symbol.module ,
267- false )
268- .symbol_expr ();
259+ const auto write_set = dfcc_utilst::create_symbol (
260+ goto_model.symbol_table ,
261+ library.dfcc_type [dfcc_typet::WRITE_SET_PTR],
262+ function_id,
263+ " __write_set_to_check" ,
264+ function_symbol.location );
269265
270266 std::set<symbol_exprt> local_statics = get_local_statics (function_id);
271267
@@ -663,7 +659,7 @@ void dfcc_instrumentt::instrument_lhs(
663659 goto_programt &goto_program,
664660 dfcc_cfg_infot &cfg_info)
665661{
666- const auto &mode =
662+ const irep_idt &mode =
667663 dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id).mode ;
668664
669665 goto_programt payload;
@@ -691,18 +687,12 @@ void dfcc_instrumentt::instrument_lhs(
691687 // ASSIGN lhs := rhs;
692688 // ```
693689
694- auto &check_sym = dfcc_utilst::create_symbol (
690+ const auto check_var = dfcc_utilst::create_symbol (
695691 goto_model.symbol_table ,
696692 bool_typet (),
697- id2string ( function_id) ,
693+ function_id,
698694 " __check_lhs_assignment" ,
699- lhs_source_location,
700- mode,
701- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
702- .module ,
703- false );
704-
705- const auto &check_var = check_sym.symbol_expr ();
695+ lhs_source_location);
706696
707697 payload.add (goto_programt::make_decl (check_var, lhs_source_location));
708698
@@ -950,22 +940,17 @@ void dfcc_instrumentt::instrument_deallocate_call(
950940 // ----
951941 // CALL __CPROVER_deallocate(ptr);
952942 // ```
953- const auto &mode =
954- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id).mode ;
955943 goto_programt payload;
956944
957945 auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
958946 dfcc_utilst::make_null_check_expr (write_set), target_location));
959947
960- auto &check_sym = get_fresh_aux_symbol (
948+ const auto check_var = dfcc_utilst::create_symbol (
949+ goto_model.symbol_table ,
961950 bool_typet (),
962- id2string ( function_id) ,
951+ function_id,
963952 " __check_deallocate" ,
964- target_location,
965- mode,
966- goto_model.symbol_table );
967-
968- const auto &check_var = check_sym.symbol_expr ();
953+ target_location);
969954
970955 payload.add (goto_programt::make_decl (check_var, target_location));
971956
@@ -977,6 +962,8 @@ void dfcc_instrumentt::instrument_deallocate_call(
977962 target_location));
978963
979964 // add property class on assertion source_location
965+ const irep_idt &mode =
966+ dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id).mode ;
980967 source_locationt check_location (target_location);
981968 check_location.set_property_class (" frees" );
982969 std::string comment =
@@ -1040,6 +1027,8 @@ void dfcc_instrumentt::instrument_other(
10401027 const auto &target_location = target->source_location ();
10411028 auto &statement = target->get_other ().get_statement ();
10421029 auto &write_set = cfg_info.get_write_set (target);
1030+ const irep_idt &mode =
1031+ dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id).mode ;
10431032
10441033 if (statement == ID_array_set || statement == ID_array_copy)
10451034 {
@@ -1054,23 +1043,17 @@ void dfcc_instrumentt::instrument_other(
10541043 // ----
10551044 // OTHER {statement = array_set, args = {dest, value}};
10561045 // ```
1057- const auto &mode =
1058- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
1059- .mode ;
10601046 goto_programt payload;
10611047
10621048 auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
10631049 dfcc_utilst::make_null_check_expr (write_set), target_location));
10641050
1065- auto &check_sym = get_fresh_aux_symbol (
1051+ const auto check_var = dfcc_utilst::create_symbol (
1052+ goto_model.symbol_table ,
10661053 bool_typet (),
1067- id2string ( function_id) ,
1054+ function_id,
10681055 is_array_set ? " __check_array_set" : " __check_array_copy" ,
1069- target_location,
1070- mode,
1071- goto_model.symbol_table );
1072-
1073- const auto &check_var = check_sym.symbol_expr ();
1056+ target_location);
10741057
10751058 payload.add (goto_programt::make_decl (check_var, target_location));
10761059
@@ -1115,23 +1098,17 @@ void dfcc_instrumentt::instrument_other(
11151098 // ----
11161099 // OTHER {statement = array_replace, args = {dest, src}};
11171100 // ```
1118- const auto &mode =
1119- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
1120- .mode ;
11211101 goto_programt payload;
11221102
11231103 auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
11241104 dfcc_utilst::make_null_check_expr (write_set), target_location));
11251105
1126- auto &check_sym = get_fresh_aux_symbol (
1106+ const auto check_var = dfcc_utilst::create_symbol (
1107+ goto_model.symbol_table ,
11271108 bool_typet (),
1128- id2string ( function_id) ,
1109+ function_id,
11291110 " __check_array_replace" ,
1130- target_location,
1131- mode,
1132- goto_model.symbol_table );
1133-
1134- const auto &check_var = check_sym.symbol_expr ();
1111+ target_location);
11351112
11361113 payload.add (goto_programt::make_decl (check_var, target_location));
11371114
@@ -1170,23 +1147,17 @@ void dfcc_instrumentt::instrument_other(
11701147 // ASSERT(check_havoc_object);
11711148 // DEAD check_havoc_object;
11721149 // ```
1173- const auto &mode =
1174- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
1175- .mode ;
11761150 goto_programt payload;
11771151
11781152 auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
11791153 dfcc_utilst::make_null_check_expr (write_set), target_location));
11801154
1181- auto &check_sym = get_fresh_aux_symbol (
1155+ const auto check_var = dfcc_utilst::create_symbol (
1156+ goto_model.symbol_table ,
11821157 bool_typet (),
1183- id2string ( function_id) ,
1158+ function_id,
11841159 " __check_havoc_object" ,
1185- target_location,
1186- mode,
1187- goto_model.symbol_table );
1188-
1189- const auto &check_var = check_sym.symbol_expr ();
1160+ target_location);
11901161
11911162 payload.add (goto_programt::make_decl (check_var, target_location));
11921163
0 commit comments