1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 20:29:34 +00:00

Fixed function parameter type conversion.

This commit is contained in:
acqn 2020-08-15 06:27:11 +08:00 committed by Oliver Schmidt
parent 632da3f4ee
commit 4e61ae5b36

View File

@ -1492,13 +1492,27 @@ static void ParseTypeSpec (DeclSpec* D, long Default, TypeCode Qualifiers,
static Type* ParamTypeCvt (Type* T)
/* If T is an array, convert it to a pointer else do nothing. Return the
** resulting type.
/* If T is an array or a function, convert it to a pointer else do nothing.
** Return the resulting type.
*/
{
Type* Tmp = 0;
if (IsTypeArray (T)) {
T->C = T_PTR;
Tmp = ArrayToPtr (T);
} else if (IsTypeFunc (T)) {
Tmp = PointerTo (T);
}
if (Tmp != 0) {
/* Do several fixes on qualifiers */
FixQualifiers (Tmp);
/* Replace the type */
TypeCopy (T, Tmp);
TypeFree (Tmp);
}
return T;
}