mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Merge branch 'zscript' into gz-zscript
This commit is contained in:
commit
b0a0056097
2 changed files with 11 additions and 9 deletions
|
@ -1847,8 +1847,8 @@ FxExpression *FxUnaryNotBoolean::Resolve(FCompileContext& ctx)
|
||||||
|
|
||||||
ExpEmit FxUnaryNotBoolean::Emit(VMFunctionBuilder *build)
|
ExpEmit FxUnaryNotBoolean::Emit(VMFunctionBuilder *build)
|
||||||
{
|
{
|
||||||
assert(Operand->ValueType == ValueType);
|
assert(Operand->ValueType == TypeBool);
|
||||||
assert(ValueType == TypeBool);
|
assert(ValueType == TypeBool || IsInteger()); // this may have been changed by an int cast.
|
||||||
ExpEmit from = Operand->Emit(build);
|
ExpEmit from = Operand->Emit(build);
|
||||||
assert(!from.Konst);
|
assert(!from.Konst);
|
||||||
// boolean not is the same as XOR-ing the lowest bit
|
// boolean not is the same as XOR-ing the lowest bit
|
||||||
|
@ -8069,11 +8069,10 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
|
||||||
{
|
{
|
||||||
if (!cls->IsDescendantOf(desttype))
|
if (!cls->IsDescendantOf(desttype))
|
||||||
{
|
{
|
||||||
ScriptPosition.Message(MSG_ERROR, "class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
|
ScriptPosition.Message(MSG_OPTERROR, "class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
|
||||||
delete this;
|
cls = nullptr;
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
ScriptPosition.Message(MSG_DEBUGLOG, "resolving '%s' as class name", clsname.GetChars());
|
else ScriptPosition.Message(MSG_DEBUGLOG, "resolving '%s' as class name", clsname.GetChars());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FxExpression *x = new FxConstant(cls, to, ScriptPosition);
|
FxExpression *x = new FxConstant(cls, to, ScriptPosition);
|
||||||
|
|
|
@ -477,9 +477,12 @@ static FxExpression *ParseExpression0 (FScanner &sc, PClassActor *cls)
|
||||||
exp = new FxRuntimeStateIndex(ParseExpressionM(sc, cls));
|
exp = new FxRuntimeStateIndex(ParseExpressionM(sc, cls));
|
||||||
}
|
}
|
||||||
// The parsed expression is of type 'statelabel', but we want a real state here so we must convert it.
|
// The parsed expression is of type 'statelabel', but we want a real state here so we must convert it.
|
||||||
|
if (!exp->isConstant())
|
||||||
|
{
|
||||||
FArgumentList args;
|
FArgumentList args;
|
||||||
args.Push(exp);
|
args.Push(exp);
|
||||||
exp = new FxFunctionCall(NAME_ResolveState, NAME_None, args, sc);
|
exp = new FxFunctionCall(NAME_ResolveState, NAME_None, args, sc);
|
||||||
|
}
|
||||||
sc.MustGetToken(')');
|
sc.MustGetToken(')');
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue