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:
parent
95f2b3e193
commit
146a591ed0
|
@ -896,13 +896,13 @@ void ExpressionParseFunctionCall(struct ParseState *Parser, struct ExpressionSta
|
||||||
{
|
{
|
||||||
/* cast char to int */
|
/* cast char to int */
|
||||||
Param->Val->Integer = Param->Val->Character;
|
Param->Val->Integer = Param->Val->Character;
|
||||||
Param->Typ == &IntType;
|
Param->Typ = &IntType;
|
||||||
}
|
}
|
||||||
else if (FuncValue->Val->FuncDef.ParamType[ArgCount] == &CharType && Param->Typ == &IntType)
|
else if (FuncValue->Val->FuncDef.ParamType[ArgCount] == &CharType && Param->Typ == &IntType)
|
||||||
{
|
{
|
||||||
/* cast int to char */
|
/* cast int to char */
|
||||||
Param->Val->Integer = Param->Val->Character;
|
Param->Val->Integer = Param->Val->Character;
|
||||||
Param->Typ == &CharType;
|
Param->Typ = &CharType;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ProgramFail(Parser, "parameter %d to %s() is the wrong type", ArgCount+1, FuncName);
|
ProgramFail(Parser, "parameter %d to %s() is the wrong type", ArgCount+1, FuncName);
|
||||||
|
|
Loading…
Reference in a new issue