GP-791 PDB Universal constructor return undefined

This commit is contained in:
ghizard 2021-03-22 10:54:55 -04:00
parent b55e34f696
commit c00feac9fe
4 changed files with 30 additions and 2 deletions

View file

@ -90,6 +90,14 @@ public abstract class AbstractMemberFunctionMsType extends AbstractMsType {
return functionAttributes; 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. * Returns the number of parameters to the function.
* @return The number of parameters. * @return The number of parameters.

View file

@ -58,4 +58,8 @@ public class FunctionMsAttributes extends AbstractParsableItem {
isInstanceConstructorOfClassWithVirtualBases = ((attributes & 0x0001) == 0x0001); isInstanceConstructorOfClassWithVirtualBases = ((attributes & 0x0001) == 0x0001);
} }
boolean isConstructor() {
return isInstanceConstructor || isInstanceConstructorOfClassWithVirtualBases;
}
} }

View file

@ -121,6 +121,14 @@ public abstract class AbstractFunctionTypeApplier extends MsTypeApplier {
*/ */
protected abstract RecordNumber getArgListRecordNumber(); 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 * Method to create the {@link DataType} based upon the type indices of the calling
* convention, return type, and arguments list. * convention, return type, and arguments list.
@ -203,6 +211,10 @@ public abstract class AbstractFunctionTypeApplier extends MsTypeApplier {
private boolean setReturnType() { private boolean setReturnType() {
if (isConstructor()) {
return false;
}
DataType returnDataType = returnApplier.getDataType(); DataType returnDataType = returnApplier.getDataType();
if (returnDataType == null) { if (returnDataType == null) {
applicator.appendLogMsg("Return type is null in " + functionDefinition.getName()); applicator.appendLogMsg("Return type is null in " + functionDefinition.getName());

View file

@ -75,6 +75,11 @@ public class MemberFunctionTypeApplier extends AbstractFunctionTypeApplier {
return ((AbstractMemberFunctionMsType) msType).getArgListRecordNumber(); return ((AbstractMemberFunctionMsType) msType).getArgListRecordNumber();
} }
@Override
protected boolean isConstructor() {
return ((AbstractMemberFunctionMsType) msType).isConstructor();
}
@Override @Override
void apply() throws PdbException, CancelledException { void apply() throws PdbException, CancelledException {
predefineClasses(); predefineClasses();
@ -175,8 +180,7 @@ public class MemberFunctionTypeApplier extends AbstractFunctionTypeApplier {
// } // }
private MsTypeApplier getThisPointerApplier(AbstractMemberFunctionMsType procType) { private MsTypeApplier getThisPointerApplier(AbstractMemberFunctionMsType procType) {
MsTypeApplier applier = MsTypeApplier applier = applicator.getTypeApplier(procType.getThisPointerRecordNumber());
applicator.getTypeApplier(procType.getThisPointerRecordNumber());
// if ((applier instanceof PrimitiveTypeApplier && // if ((applier instanceof PrimitiveTypeApplier &&
// ((PrimitiveTypeApplier) applier).isNoType())) { // ((PrimitiveTypeApplier) applier).isNoType())) {