mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
Fixed crash with non-inlined __fastcall__ function invocation with no arguments.
This commit is contained in:
parent
3755e4a863
commit
f273b1ebcb
@ -835,7 +835,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall, ExprDesc* ED)
|
||||
/* Append last deferred inc/dec before the function is called.
|
||||
** The last parameter needs to be preserved if it is passed in AX/EAX Regs.
|
||||
*/
|
||||
DoDeferred (IsFastcall ? SQP_KEEP_EAX : SQP_KEEP_NONE, &Expr);
|
||||
DoDeferred (IsFastcall && PushedCount > 0 ? SQP_KEEP_EAX : SQP_KEEP_NONE, &Expr);
|
||||
|
||||
/* Check if we had enough arguments */
|
||||
if (PushedCount < Func->ParamCount) {
|
||||
@ -928,7 +928,8 @@ static void FunctionCall (ExprDesc* Expr)
|
||||
}
|
||||
|
||||
/* If we didn't inline the function, get fastcall info */
|
||||
IsFastcall = IsFastcallFunc (Expr->Type);
|
||||
IsFastcall = (Func->ParamCount > 0 || (Func->Flags & FD_EMPTY) != 0) &&
|
||||
IsFastcallFunc (Expr->Type);
|
||||
}
|
||||
|
||||
/* Parse the parameter list */
|
||||
|
Loading…
x
Reference in New Issue
Block a user