From 0ba074995c2b80372268c6e3e792e01cbe955fdf Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 11 Jul 2004 13:47:57 +0000 Subject: [PATCH] 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 --- src/cc65/expr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 */ -- 2.39.5