From: cuz Date: Sun, 26 May 2002 11:08:17 +0000 (+0000) Subject: Indirect fastcall functions with no parameters may be called as if it were X-Git-Tag: V2.12.0~2330 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=21afe25e90af7c4dad927442ca0239bbda6a31f6;p=cc65 Indirect fastcall functions with no parameters may be called as if it were cdecl functions, this generates better code. Remove a small error that caused indirect non fastcall function to always be handled as variadic, which meant a useless load of the Y register was added. git-svn-id: svn://svn.cc65.org/cc65/trunk@1292 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index f39b2ce11..2bf506bbf 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -726,8 +726,8 @@ static void FunctionCall (int k, ExprDesc* lval) IsFuncPtr = IsTypeFuncPtr (lval->Type); if (IsFuncPtr) { - /* Check wether it's a fastcall function */ - IsFastCall = IsFastCallFunc (lval->Type + 1); + /* Check wether it's a fastcall function that has parameters */ + IsFastCall = IsFastCallFunc (lval->Type + 1) && (Func->ParamCount > 0); /* Things may be difficult, depending on where the function pointer * resides. If the function pointer is an expression of some sort @@ -797,7 +797,7 @@ static void FunctionCall (int k, ExprDesc* lval) } /* Call the function */ - g_callind (TypeOf (lval->Type), ParamSize, PtrOffs); + g_callind (TypeOf (lval->Type+1), ParamSize, PtrOffs); } else {