From: MaartenBrock Date: Sun, 24 Feb 2008 16:35:14 +0000 (+0000) Subject: * src/SDCCast.c (expandInlineFuncs): fixed bug 1875869 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=58d700d54729a1183a911d2f36959b101a0d6e61;p=fw%2Fsdcc * src/SDCCast.c (expandInlineFuncs): fixed bug 1875869 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5042 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index e0b1aa68..de4bd271 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-24 Maarten Brock + + * src/SDCCast.c (expandInlineFuncs): fixed bug 1875869 + 2008-02-22 Philipp Klaus Krause * src/z80/gen.c (genMult): Rewrote 8-bit multiplication by constant, diff --git a/src/SDCCast.c b/src/SDCCast.c index fa33a799..2fd83186 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -4154,7 +4154,7 @@ decorateType (ast * tree, RESULT_TYPE resultType) werrorfl (tree->filename, tree->lineno, W_COMP_RANGE, ccr_result == CCR_ALWAYS_TRUE ? "true" : "false"); return decorateType (newAst_VALUE (constCharVal ( - ccr_result == CCR_ALWAYS_TRUE ? 1 : 0)), + (unsigned char)(ccr_result == CCR_ALWAYS_TRUE ? 1 : 0))), resultType); case CCR_OK: default: @@ -6303,14 +6303,19 @@ expandInlineFuncs (ast * tree, ast * block) while (args) { symbol * temparg; - ast * passedarg; ast * assigntree; - symbol * parm = copySymbol (args->sym); + symbol * parm; + ast * passedarg = inlineFindParm (tree->right, argIndex); + + if (!passedarg) + { + werror(E_TOO_FEW_PARMS); + break; + } temparg = inlineTempVar (args->sym->type, tree->level+1); inlineAddDecl (temparg, inlinetree, FALSE); - passedarg = inlineFindParm (tree->right, argIndex); assigntree = newNode ('=', newAst_VALUE (symbolVal (temparg)), passedarg); @@ -6318,6 +6323,7 @@ expandInlineFuncs (ast * tree, ast * block) assigntree, inlinetree->right); + parm = copySymbol (args->sym); inlineAddDecl (parm, inlinetree2, FALSE); parm->_isparm = 0;