Fixed a bug in char<->int coercion in parameter passing.

git-svn-id: http://picoc.googlecode.com/svn/trunk@263 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-04-22 22:05:27 +00:00
parent 95f2b3e193
commit 146a591ed0

View file

@ -896,13 +896,13 @@ void ExpressionParseFunctionCall(struct ParseState *Parser, struct ExpressionSta
{
/* cast char to int */
Param->Val->Integer = Param->Val->Character;
Param->Typ == &IntType;
Param->Typ = &IntType;
}
else if (FuncValue->Val->FuncDef.ParamType[ArgCount] == &CharType && Param->Typ == &IntType)
{
/* cast int to char */
Param->Val->Integer = Param->Val->Character;
Param->Typ == &CharType;
Param->Typ = &CharType;
}
else
ProgramFail(Parser, "parameter %d to %s() is the wrong type", ArgCount+1, FuncName);