From 21afe25e90af7c4dad927442ca0239bbda6a31f6 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 26 May 2002 11:08:17 +0000 Subject: [PATCH] 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 --- src/cc65/expr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { -- 2.39.5