@@ -256,16 +256,12 @@ void dfcc_instrumentt::instrument_harness_function(
256
256
// create a local write set symbol
257
257
const auto &function_symbol =
258
258
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 );
269
265
270
266
std::set<symbol_exprt> local_statics = get_local_statics (function_id);
271
267
@@ -663,7 +659,7 @@ void dfcc_instrumentt::instrument_lhs(
663
659
goto_programt &goto_program,
664
660
dfcc_cfg_infot &cfg_info)
665
661
{
666
- const auto &mode =
662
+ const irep_idt &mode =
667
663
dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id).mode ;
668
664
669
665
goto_programt payload;
@@ -691,18 +687,12 @@ void dfcc_instrumentt::instrument_lhs(
691
687
// ASSIGN lhs := rhs;
692
688
// ```
693
689
694
- auto &check_sym = dfcc_utilst::create_symbol (
690
+ const auto check_var = dfcc_utilst::create_symbol (
695
691
goto_model.symbol_table ,
696
692
bool_typet (),
697
- id2string ( function_id) ,
693
+ function_id,
698
694
" __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);
706
696
707
697
payload.add (goto_programt::make_decl (check_var, lhs_source_location));
708
698
@@ -950,22 +940,17 @@ void dfcc_instrumentt::instrument_deallocate_call(
950
940
// ----
951
941
// CALL __CPROVER_deallocate(ptr);
952
942
// ```
953
- const auto &mode =
954
- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id).mode ;
955
943
goto_programt payload;
956
944
957
945
auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
958
946
dfcc_utilst::make_null_check_expr (write_set), target_location));
959
947
960
- auto &check_sym = get_fresh_aux_symbol (
948
+ const auto check_var = dfcc_utilst::create_symbol (
949
+ goto_model.symbol_table ,
961
950
bool_typet (),
962
- id2string ( function_id) ,
951
+ function_id,
963
952
" __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);
969
954
970
955
payload.add (goto_programt::make_decl (check_var, target_location));
971
956
@@ -977,6 +962,8 @@ void dfcc_instrumentt::instrument_deallocate_call(
977
962
target_location));
978
963
979
964
// 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 ;
980
967
source_locationt check_location (target_location);
981
968
check_location.set_property_class (" frees" );
982
969
std::string comment =
@@ -1040,6 +1027,8 @@ void dfcc_instrumentt::instrument_other(
1040
1027
const auto &target_location = target->source_location ();
1041
1028
auto &statement = target->get_other ().get_statement ();
1042
1029
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 ;
1043
1032
1044
1033
if (statement == ID_array_set || statement == ID_array_copy)
1045
1034
{
@@ -1054,23 +1043,17 @@ void dfcc_instrumentt::instrument_other(
1054
1043
// ----
1055
1044
// OTHER {statement = array_set, args = {dest, value}};
1056
1045
// ```
1057
- const auto &mode =
1058
- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
1059
- .mode ;
1060
1046
goto_programt payload;
1061
1047
1062
1048
auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
1063
1049
dfcc_utilst::make_null_check_expr (write_set), target_location));
1064
1050
1065
- auto &check_sym = get_fresh_aux_symbol (
1051
+ const auto check_var = dfcc_utilst::create_symbol (
1052
+ goto_model.symbol_table ,
1066
1053
bool_typet (),
1067
- id2string ( function_id) ,
1054
+ function_id,
1068
1055
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);
1074
1057
1075
1058
payload.add (goto_programt::make_decl (check_var, target_location));
1076
1059
@@ -1115,23 +1098,17 @@ void dfcc_instrumentt::instrument_other(
1115
1098
// ----
1116
1099
// OTHER {statement = array_replace, args = {dest, src}};
1117
1100
// ```
1118
- const auto &mode =
1119
- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
1120
- .mode ;
1121
1101
goto_programt payload;
1122
1102
1123
1103
auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
1124
1104
dfcc_utilst::make_null_check_expr (write_set), target_location));
1125
1105
1126
- auto &check_sym = get_fresh_aux_symbol (
1106
+ const auto check_var = dfcc_utilst::create_symbol (
1107
+ goto_model.symbol_table ,
1127
1108
bool_typet (),
1128
- id2string ( function_id) ,
1109
+ function_id,
1129
1110
" __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);
1135
1112
1136
1113
payload.add (goto_programt::make_decl (check_var, target_location));
1137
1114
@@ -1170,23 +1147,17 @@ void dfcc_instrumentt::instrument_other(
1170
1147
// ASSERT(check_havoc_object);
1171
1148
// DEAD check_havoc_object;
1172
1149
// ```
1173
- const auto &mode =
1174
- dfcc_utilst::get_function_symbol (goto_model.symbol_table , function_id)
1175
- .mode ;
1176
1150
goto_programt payload;
1177
1151
1178
1152
auto goto_instruction = payload.add (goto_programt::make_incomplete_goto (
1179
1153
dfcc_utilst::make_null_check_expr (write_set), target_location));
1180
1154
1181
- auto &check_sym = get_fresh_aux_symbol (
1155
+ const auto check_var = dfcc_utilst::create_symbol (
1156
+ goto_model.symbol_table ,
1182
1157
bool_typet (),
1183
- id2string ( function_id) ,
1158
+ function_id,
1184
1159
" __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);
1190
1161
1191
1162
payload.add (goto_programt::make_decl (check_var, target_location));
1192
1163
0 commit comments