mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +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
d99aeb0895
commit
8597c9e326
1 changed files with 5 additions and 1 deletions
|
@ -382,7 +382,11 @@ void FxExpression::EmitCompare(VMFunctionBuilder *build, bool invert, TArray<siz
|
||||||
{
|
{
|
||||||
ExpEmit op = Emit(build);
|
ExpEmit op = Emit(build);
|
||||||
ExpEmit i;
|
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)
|
switch (op.RegType)
|
||||||
{
|
{
|
||||||
case REGT_INT:
|
case REGT_INT:
|
||||||
|
|
Loading…
Reference in a new issue