diff --git a/module.cpp b/module.cpp index 3ea11e9a..0c945dba 100644 --- a/module.cpp +++ b/module.cpp @@ -1678,6 +1678,7 @@ lGetExportedTypes(const Type *type, std::vector *exportedVectorTypes) { const ArrayType *arrayType = CastType(type); const StructType *structType = CastType(type); + const FunctionType *ftype = CastType(type); if (CastType(type) != NULL) lGetExportedTypes(type->GetReferenceTarget(), exportedStructTypes, @@ -1701,7 +1702,17 @@ lGetExportedTypes(const Type *type, lAddTypeIfNew(type, exportedEnumTypes); else if (CastType(type) != NULL) lAddTypeIfNew(type, exportedVectorTypes); - else + else if (ftype != NULL) { + // Handle Return Types + lGetExportedTypes(ftype->GetReturnType(), exportedStructTypes, + exportedEnumTypes, exportedVectorTypes); + + // And now the parameter types... + for (int j = 0; j < ftype->GetNumParameters(); ++j) + lGetExportedTypes(ftype->GetParameterType(j), exportedStructTypes, + exportedEnumTypes, exportedVectorTypes); + } + else Assert(CastType(type) != NULL); }