mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +00:00
- added warning for constant conditional expression
ZScript code like `if (x = 0) // ...` no longer causes assertion failure in Debug but produces a warning regadless of configuration https://forum.zdoom.org/viewtopic.php?t=62422
This commit is contained in:
parent
bde980d5e8
commit
08dfdd2687
1 changed files with 5 additions and 1 deletions
|
@ -390,7 +390,11 @@ void FxExpression::EmitCompare(VMFunctionBuilder *build, bool invert, TArray<siz
|
|||
{
|
||||
ExpEmit op = Emit(build);
|
||||
ExpEmit i;
|
||||
assert(op.RegType != REGT_NIL && op.RegCount == 1 && !op.Konst);
|
||||
assert(op.RegType != REGT_NIL && op.RegCount == 1);
|
||||
if (op.Konst)
|
||||
{
|
||||
ScriptPosition.Message(MSG_WARNING, "Conditional expression is constant");
|
||||
}
|
||||
switch (op.RegType)
|
||||
{
|
||||
case REGT_INT:
|
||||
|
|
Loading…
Reference in a new issue