File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -875,11 +875,21 @@ bool java_bytecode_languaget::typecheck(
875
875
// Now add synthetic classes for every invokedynamic instruction found (it
876
876
// makes this easier that all interface types and their methods have been
877
877
// created above):
878
- for (const auto &id_and_symbol : symbol_table)
879
878
{
880
- const auto &symbol = id_and_symbol.second ;
881
- const auto &id = symbol.name ;
882
- if (can_cast_type<code_typet>(symbol.type ) && method_bytecode.get (id))
879
+ std::vector<irep_idt> methods_to_check;
880
+
881
+ // Careful not to add to the symtab while iterating over it:
882
+ for (const auto &id_and_symbol : symbol_table)
883
+ {
884
+ const auto &symbol = id_and_symbol.second ;
885
+ const auto &id = symbol.name ;
886
+ if (can_cast_type<code_typet>(symbol.type ) && method_bytecode.get (id))
887
+ {
888
+ methods_to_check.push_back (id);
889
+ }
890
+ }
891
+
892
+ for (const auto &id : methods_to_check)
883
893
{
884
894
create_invokedynamic_synthetic_classes (
885
895
id,
You can’t perform that action at this time.
0 commit comments