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(
875875 // Now add synthetic classes for every invokedynamic instruction found (it
876876 // makes this easier that all interface types and their methods have been
877877 // created above):
878- for (const auto &id_and_symbol : symbol_table)
879878 {
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)
883893 {
884894 create_invokedynamic_synthetic_classes (
885895 id,
You can’t perform that action at this time.
0 commit comments