Skip to content

Commit 971a34b

Browse files
author
Lukasz A.J. Wrona
committed
Always load cprover-nondet-initialize
1 parent 8de6a33 commit 971a34b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

jbmc/src/java_bytecode/ci_lazy_methods.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ bool ci_lazy_methodst::operator()(
248248
}
249249
}
250250

251+
// cproverNondetInitialize has to be force-loaded for mocks to return valid
252+
// objects (objects which satisfy invariants specified in the
253+
// cproverNondetInitialize method)
254+
for(const auto &class_name : instantiated_classes)
255+
{
256+
const irep_idt cprover_validate =
257+
id2string(class_name) + ".cproverNondetInitialize:()V";
258+
if(symbol_table.symbols.count(cprover_validate))
259+
methods_already_populated.insert(cprover_validate);
260+
}
261+
251262
// Remove symbols for methods that were declared but never used:
252263
symbol_tablet keep_symbols;
253264
// Manually keep @inflight_exception, as it is unused at this stage

0 commit comments

Comments
 (0)