Skip to content

Commit 3c95aa1

Browse files
Prevent attempting to load any class more than once
1 parent c520331 commit 3c95aa1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

regression/cbmc-java/provide_object_implementation/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
java/lang/Object.class
33

44
^EXIT=6$

src/java_bytecode/java_bytecode_convert_class.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ void java_bytecode_convert_classt::operator()(
185185
PRECONDITION(!parse_trees.empty());
186186
const irep_idt &class_name = parse_trees.front().parsed_class.name;
187187

188+
if(symbol_table.has_symbol("java::" + id2string(class_name)))
189+
{
190+
debug() << "Skip class " << class_name << " (already loaded)" << eom;
191+
return;
192+
}
193+
188194
// Add array types to the symbol table
189195
add_array_types(symbol_table);
190196

0 commit comments

Comments
 (0)