mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 17:41:19 +00:00
Fixed code generation of infinite for loop
https://forum.zdoom.org/viewtopic.php?t=62023
This commit is contained in:
parent
c320a92dcf
commit
7736504a22
1 changed files with 6 additions and 1 deletions
|
@ -10299,9 +10299,14 @@ FxWhileLoop::~FxWhileLoop()
|
||||||
FxExpression *FxWhileLoop::DoResolve(FCompileContext &ctx)
|
FxExpression *FxWhileLoop::DoResolve(FCompileContext &ctx)
|
||||||
{
|
{
|
||||||
CHECKRESOLVED();
|
CHECKRESOLVED();
|
||||||
SAFE_RESOLVE(Condition, ctx);
|
SAFE_RESOLVE_OPT(Condition, ctx);
|
||||||
SAFE_RESOLVE_OPT(Code, ctx);
|
SAFE_RESOLVE_OPT(Code, ctx);
|
||||||
|
|
||||||
|
if (Condition == nullptr)
|
||||||
|
{
|
||||||
|
Condition = new FxConstant(true, ScriptPosition);
|
||||||
|
}
|
||||||
|
|
||||||
if (Condition->ValueType != TypeBool)
|
if (Condition->ValueType != TypeBool)
|
||||||
{
|
{
|
||||||
Condition = new FxBoolCast(Condition);
|
Condition = new FxBoolCast(Condition);
|
||||||
|
|
Loading…
Reference in a new issue