diff --git a/module.cpp b/module.cpp index 78cbe26f..47c21e34 100644 --- a/module.cpp +++ b/module.cpp @@ -554,8 +554,10 @@ static void lCheckForVaryingParameter(const Type *type, const std::string &name, SourcePos pos) { if (lRecursiveCheckValidParamType(type)) { - const Type *t = type->GetBaseType(); - if (CastType(t)) + if (CastType(type)) + Error(pos, "Varying pointer type parameter \"%s\" is illegal " + "in an exported function.", name.c_str()); + else if (CastType(type->GetBaseType())) Error(pos, "Struct parameter \"%s\" with varying member(s) is illegal " "in an exported function.", name.c_str()); else