mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Fixed a bug: The compiler aborted with an internal error if a non function
was called as a function after printing the diagnostic. git-svn-id: svn://svn.cc65.org/cc65/trunk@3526 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
82751788fd
commit
c218639977
@ -639,7 +639,7 @@ static void Primary (ExprDesc* E)
|
|||||||
Error ("Preprocessor expression expected");
|
Error ("Preprocessor expression expected");
|
||||||
ED_MakeConstAbsInt (E, 1);
|
ED_MakeConstAbsInt (E, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (CurTok.Tok) {
|
switch (CurTok.Tok) {
|
||||||
|
|
||||||
@ -819,7 +819,7 @@ static void ArrayRef (ExprDesc* Expr)
|
|||||||
* address. This is true for most arrays and will produce a lot better
|
* address. This is true for most arrays and will produce a lot better
|
||||||
* code. Check if this is a const base address.
|
* code. Check if this is a const base address.
|
||||||
*/
|
*/
|
||||||
ConstBaseAddr = ED_IsRVal (Expr) &&
|
ConstBaseAddr = ED_IsRVal (Expr) &&
|
||||||
(ED_IsLocConst (Expr) || ED_IsLocStack (Expr));
|
(ED_IsLocConst (Expr) || ED_IsLocStack (Expr));
|
||||||
|
|
||||||
/* If we have a constant base, we delay the address fetch */
|
/* If we have a constant base, we delay the address fetch */
|
||||||
@ -1123,6 +1123,9 @@ static void StructRef (ExprDesc* Expr)
|
|||||||
static void hie11 (ExprDesc *Expr)
|
static void hie11 (ExprDesc *Expr)
|
||||||
/* Handle compound types (structs and arrays) */
|
/* Handle compound types (structs and arrays) */
|
||||||
{
|
{
|
||||||
|
/* Name value used in invalid function calls */
|
||||||
|
static const char IllegalFunc[] = "illegal_function_call";
|
||||||
|
|
||||||
/* Evaluate the lhs */
|
/* Evaluate the lhs */
|
||||||
Primary (Expr);
|
Primary (Expr);
|
||||||
|
|
||||||
@ -1144,10 +1147,10 @@ static void hie11 (ExprDesc *Expr)
|
|||||||
Error ("Illegal function call");
|
Error ("Illegal function call");
|
||||||
/* Force the type to be a implicitly defined function, one
|
/* Force the type to be a implicitly defined function, one
|
||||||
* returning an int and taking any number of arguments.
|
* returning an int and taking any number of arguments.
|
||||||
* Since we don't have a name, place it at absolute address
|
* Since we don't have a name, invent one.
|
||||||
* zero.
|
|
||||||
*/
|
*/
|
||||||
ED_MakeConstAbs (Expr, 0, GetImplicitFuncType ());
|
ED_MakeConstAbs (Expr, 0, GetImplicitFuncType ());
|
||||||
|
Expr->Name = (long) IllegalFunc;
|
||||||
}
|
}
|
||||||
/* Call the function */
|
/* Call the function */
|
||||||
FunctionCall (Expr);
|
FunctionCall (Expr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user