Don't throw away unsignedness when passing unsigned constants to the codegen

This commit is contained in:
Marisa Heit 2022-08-01 23:11:21 -05:00 committed by Christoph Oelckers
parent 7ce29fe855
commit f7f9746a0f

View file

@ -2808,7 +2808,14 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast, bool substitute)
} }
else if (cnst->Type->isInt()) 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) else if (cnst->Type == TypeBool)
{ {