Skip to content

Commit

Permalink
Don't throw away unsignedness when passing unsigned constants to the …
Browse files Browse the repository at this point in the history
…codegen
  • Loading branch information
rheit authored and coelckers committed Aug 2, 2022
1 parent 7ce29fe commit f7f9746
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/scripting/frontend/zcc_compile.cpp
Expand Up @@ -2808,7 +2808,14 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast, bool substitute)
}
else if (cnst->Type->isInt())
{
return new FxConstant(cnst->IntVal, *ast);
if (cnst->Type == TypeUInt32)
{
return new FxConstant((unsigned)cnst->IntVal, *ast);
}
else
{
return new FxConstant(cnst->IntVal, *ast);
}
}
else if (cnst->Type == TypeBool)
{
Expand Down

0 comments on commit f7f9746

Please sign in to comment.