Skip to content

Commit 20fb068

Browse files
author
thk123
committed
Added overload with the identiy pointer_selector
1 parent 96fdb9e commit 20fb068

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

src/goto-programs/convert_nondet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ static goto_programt::targett insert_nondet_init_code(
8989
allocation_typet::DYNAMIC,
9090
!nullable,
9191
max_nondet_array_length,
92-
std::make_shared<select_pointer_typet>(),
9392
update_in_placet::NO_UPDATE_IN_PLACE);
9493

9594
// Convert this code into goto instructions

src/java_bytecode/java_bytecode_instrument.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ codet java_bytecode_instrumentt::throw_exception(
114114
symbol_table,
115115
max_array_length,
116116
allocation_typet::LOCAL,
117-
original_loc,
118-
std::make_shared<select_pointer_typet>());
117+
original_loc);
119118
}
120119
else
121120
exc=symbol_table.lookup(exc_obj_name).symbol_expr();

src/java_bytecode/java_object_factory.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,3 +1071,49 @@ void gen_nondet_init(
10711071

10721072
init_code.append(assignments);
10731073
}
1074+
1075+
/// Call object_factory with a default (identity) pointer_type_selector
1076+
exprt object_factory(const typet &type,
1077+
const irep_idt base_name,
1078+
code_blockt &init_code,
1079+
bool allow_null,
1080+
symbol_tablet &symbol_table,
1081+
size_t max_nondet_array_length,
1082+
allocation_typet alloc_type,
1083+
const source_locationt &location)
1084+
{
1085+
return object_factory(
1086+
type,
1087+
base_name,
1088+
init_code,
1089+
allow_null,
1090+
symbol_table,
1091+
max_nondet_array_length,
1092+
alloc_type,
1093+
location,
1094+
std::make_shared<select_pointer_typet>());
1095+
}
1096+
1097+
/// Call gen_nondet_init with a default (identity) pointer_type_selector
1098+
void gen_nondet_init(const exprt &expr,
1099+
code_blockt &init_code,
1100+
symbol_tablet &symbol_table,
1101+
const source_locationt &loc,
1102+
bool skip_classid,
1103+
allocation_typet alloc_type,
1104+
bool assume_non_null,
1105+
size_t max_nondet_array_length,
1106+
update_in_placet update_in_place)
1107+
{
1108+
gen_nondet_init(
1109+
expr,
1110+
init_code,
1111+
symbol_table,
1112+
loc,
1113+
skip_classid,
1114+
alloc_type,
1115+
assume_non_null,
1116+
max_nondet_array_length,
1117+
std::make_shared<select_pointer_typet>(),
1118+
update_in_place);
1119+
}

src/java_bytecode/java_object_factory.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ exprt object_factory(
3838
const source_locationt &location,
3939
std::shared_ptr<select_pointer_typet> pointer_type_selector);
4040

41+
exprt object_factory(
42+
const typet &type,
43+
const irep_idt base_name,
44+
code_blockt &init_code,
45+
bool allow_null,
46+
symbol_tablet &symbol_table,
47+
size_t max_nondet_array_length,
48+
allocation_typet alloc_type,
49+
const source_locationt &location);
50+
4151
enum class update_in_placet
4252
{
4353
NO_UPDATE_IN_PLACE,
@@ -57,6 +67,17 @@ void gen_nondet_init(
5767
std::shared_ptr<select_pointer_typet> pointer_type_selector,
5868
update_in_placet update_in_place);
5969

70+
void gen_nondet_init(
71+
const exprt &expr,
72+
code_blockt &init_code,
73+
symbol_tablet &symbol_table,
74+
const source_locationt &loc,
75+
bool skip_classid,
76+
allocation_typet alloc_type,
77+
bool assume_non_null,
78+
size_t max_nondet_array_length,
79+
update_in_placet update_in_place);
80+
6081
exprt allocate_dynamic_object(
6182
const exprt &target_expr,
6283
const typet &allocate_type,

0 commit comments

Comments
 (0)