diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java index 73d45f4e85..81310f47f5 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java @@ -1111,7 +1111,9 @@ abstract public class DataTypeManagerDB implements DataTypeManager { } else { buildSortedDataTypeList(); - Iterator it = sortedDataTypes.iterator(); + // make copy of sortedDataTypes list before iterating as dt.dataTypeReplaced may + // call back into this class and cause a modification to the sortedDataTypes list. + Iterator it = new ArrayList<>(sortedDataTypes).iterator(); while (it.hasNext()) { DataType dt = it.next(); dt.dataTypeReplaced(existingDt, newDt);