diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java index 958c90c891..6f2ffdd3c8 100644 --- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java +++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -184,6 +184,17 @@ class PdbDataTypeParser { String dataTypeName = datatype; + // Handle potential malformed datatypes where some datatype is implied + // * + // ** + // [16] + if (dataTypeName.startsWith("*") || dataTypeName.startsWith("[")) { + // prepend undefined since intent is some datatype + Msg.warn(this, "dataTypeName \"" + dataTypeName + + "\" references a pointer or array without a declared datatype; assuming undefined"); + dataTypeName = "undefined" + dataTypeName; + } + // Example type representations: // char *[2][3] pointer(array(array(char,3),2)) // char *[2][3] * pointer(array(array(pointer(char),3),2))