diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java index 8a8bd055f2..4274fa637e 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java @@ -261,7 +261,16 @@ public class PcodeDataTypeManager { if (type instanceof Array) { return buildType(type, size); } - if (!(type instanceof FunctionDefinition) && type.getLength() <= 0) { + if (type instanceof FunctionDefinition) { + long id = progDataTypes.getID(type); + if (id <= 0) { + // Its possible the FunctionDefinition was built on the fly and is not + // a permanent data-type of the program with an ID. In this case, we can't + // construct a tag but must build a full tag. + return buildType(type, size); + } + } + else if (type.getLength() <= 0) { return buildType(type, size); } StringBuilder resBuf = new StringBuilder();