Fixed an error: If an expression is loaded into the primary, a function must
be converted to pointer-to-function and an array to pointer-to-member resp. git-svn-id: svn://svn.cc65.org/cc65/trunk@3977 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -548,14 +548,11 @@ Type* Indirect (Type* T)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Type* ArrayToPtr (const Type* T)
|
Type* ArrayToPtr (Type* T)
|
||||||
/* Convert an array to a pointer to it's first element */
|
/* Convert an array to a pointer to it's first element */
|
||||||
{
|
{
|
||||||
/* Function must only be called for an array */
|
|
||||||
CHECK (IsTypeArray (T));
|
|
||||||
|
|
||||||
/* Return pointer to first element */
|
/* Return pointer to first element */
|
||||||
return PointerTo (T + 1);
|
return PointerTo (GetElementType (T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -703,8 +700,10 @@ Type* PtrConversion (Type* T)
|
|||||||
* return T.
|
* return T.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
if (IsTypeFunc (T) || IsTypeArray (T)) {
|
if (IsTypeFunc (T)) {
|
||||||
return PointerTo (T);
|
return PointerTo (T);
|
||||||
|
} else if (IsTypeArray (T)) {
|
||||||
|
return ArrayToPtr (T);
|
||||||
} else {
|
} else {
|
||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ Type* Indirect (Type* T);
|
|||||||
* given type points to.
|
* given type points to.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Type* ArrayToPtr (const Type* T);
|
Type* ArrayToPtr (Type* T);
|
||||||
/* Convert an array to a pointer to it's first element */
|
/* Convert an array to a pointer to it's first element */
|
||||||
|
|
||||||
#if defined(HAVE_INLINE)
|
#if defined(HAVE_INLINE)
|
||||||
|
|||||||
@@ -171,6 +171,11 @@ void LoadExpr (unsigned Flags, struct ExprDesc* Expr)
|
|||||||
ED_TestDone (Expr);
|
ED_TestDone (Expr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Do standard pointer conversions since the expression is now in the
|
||||||
|
* primary.
|
||||||
|
*/
|
||||||
|
Expr->Type = PtrConversion (Expr->Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user