Skip to content

Commit 81408c5

Browse files
committed
Object factory: warn when an enum cannot be properly initialised
1 parent 46729ac commit 81408c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,11 @@ bool java_object_factoryt::gen_nondet_enum_init(
14801480
const irep_idt &class_name = java_class_type.get_name();
14811481
const irep_idt values_name = id2string(class_name) + ".$VALUES";
14821482
if(!ns.get_symbol_table().has_symbol(values_name))
1483+
{
1484+
log.warning() << values_name << " is missing, so the corresponding Enum "
1485+
"type will nondet initialised" << messaget::eom;
14831486
return false;
1487+
}
14841488

14851489
const symbolt &values = ns.lookup(values_name);
14861490

0 commit comments

Comments
 (0)