mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
GP-791 PDB Universal constructor return undefined
This commit is contained in:
parent
b55e34f696
commit
c00feac9fe
4 changed files with 30 additions and 2 deletions
|
@ -90,6 +90,14 @@ public abstract class AbstractMemberFunctionMsType extends AbstractMsType {
|
|||
return functionAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if known to be a constructor.
|
||||
* @return true if constructor.
|
||||
*/
|
||||
public boolean isConstructor() {
|
||||
return functionAttributes.isConstructor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of parameters to the function.
|
||||
* @return The number of parameters.
|
||||
|
|
|
@ -58,4 +58,8 @@ public class FunctionMsAttributes extends AbstractParsableItem {
|
|||
isInstanceConstructorOfClassWithVirtualBases = ((attributes & 0x0001) == 0x0001);
|
||||
}
|
||||
|
||||
boolean isConstructor() {
|
||||
return isInstanceConstructor || isInstanceConstructorOfClassWithVirtualBases;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -121,6 +121,14 @@ public abstract class AbstractFunctionTypeApplier extends MsTypeApplier {
|
|||
*/
|
||||
protected abstract RecordNumber getArgListRecordNumber();
|
||||
|
||||
/**
|
||||
* Returns if known to be a constructor.
|
||||
* @return true if constructor.
|
||||
*/
|
||||
protected boolean isConstructor() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to create the {@link DataType} based upon the type indices of the calling
|
||||
* convention, return type, and arguments list.
|
||||
|
@ -203,6 +211,10 @@ public abstract class AbstractFunctionTypeApplier extends MsTypeApplier {
|
|||
|
||||
private boolean setReturnType() {
|
||||
|
||||
if (isConstructor()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DataType returnDataType = returnApplier.getDataType();
|
||||
if (returnDataType == null) {
|
||||
applicator.appendLogMsg("Return type is null in " + functionDefinition.getName());
|
||||
|
|
|
@ -75,6 +75,11 @@ public class MemberFunctionTypeApplier extends AbstractFunctionTypeApplier {
|
|||
return ((AbstractMemberFunctionMsType) msType).getArgListRecordNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isConstructor() {
|
||||
return ((AbstractMemberFunctionMsType) msType).isConstructor();
|
||||
}
|
||||
|
||||
@Override
|
||||
void apply() throws PdbException, CancelledException {
|
||||
predefineClasses();
|
||||
|
@ -175,8 +180,7 @@ public class MemberFunctionTypeApplier extends AbstractFunctionTypeApplier {
|
|||
// }
|
||||
|
||||
private MsTypeApplier getThisPointerApplier(AbstractMemberFunctionMsType procType) {
|
||||
MsTypeApplier applier =
|
||||
applicator.getTypeApplier(procType.getThisPointerRecordNumber());
|
||||
MsTypeApplier applier = applicator.getTypeApplier(procType.getThisPointerRecordNumber());
|
||||
|
||||
// if ((applier instanceof PrimitiveTypeApplier &&
|
||||
// ((PrimitiveTypeApplier) applier).isNoType())) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue