Skip to content

Commit 0dfcf6a

Browse files
Do not call assign_from_json if not in symbol_table
The assign_from_json will fail with an invariant failure if it is called on a method name that does not exist in the symbol table so we should be careful when calling it.
1 parent 415ecab commit 0dfcf6a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jbmc/src/java_bytecode/java_static_initializers.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,13 @@ code_blockt get_user_specified_clinit_body(
817817
}
818818
}
819819
}
820+
if(symbol_table.lookup(real_clinit_name) == nullptr)
821+
{
822+
// Case where there is a user provided clinit, but the real clinit
823+
// doesn't appear in the symbol table. This may occur when some class
824+
// substitution happened after compilation.
825+
return code_blockt{};
826+
}
820827
code_blockt body;
821828
for(const auto &value_pair : static_field_values)
822829
{

0 commit comments

Comments
 (0)