From: cuz Date: Sun, 11 Jul 2004 13:47:57 +0000 (+0000) Subject: Check for invalid function names before trying to compare the name against X-Git-Tag: V2.12.0~678 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ba074995c2b80372268c6e3e792e01cbe955fdf;p=cc65 Check for invalid function names before trying to compare the name against the names of known standard functions. git-svn-id: svn://svn.cc65.org/cc65/trunk@3154 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 1caadef14..da616b01d 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -492,7 +492,6 @@ static void FunctionCall (ExprDesc* Expr) { FuncDesc* Func; /* Function descriptor */ int IsFuncPtr; /* Flag */ - int StdFunc; /* Standard function index */ unsigned ParamSize; /* Number of parameter bytes */ CodeMark Mark; int PtrOffs = 0; /* Offset of function pointer on stack */ @@ -538,12 +537,13 @@ static void FunctionCall (ExprDesc* Expr) } /* Check for known standard functions and inline them */ - } else if ((StdFunc = FindStdFunc ((const char*) Expr->Name)) >= 0) { - - /* Inline this function */ - HandleStdFunc (StdFunc, Func, Expr); - return; - + } else if (Expr->Name != 0) { + int StdFunc = FindStdFunc ((const char*) Expr->Name); + if (StdFunc >= 0) { + /* Inline this function */ + HandleStdFunc (StdFunc, Func, Expr); + return; + } } /* Parse the parameter list */