- allow A_M_Refire to be called without state label because this seems to have been used in existing DECORATE mods. This way of calling it will revert to the old behavior of jumping one state forward instead of to a state label.

This commit is contained in:
Christoph Oelckers 2016-12-11 13:07:25 +01:00
commit 40355f6298
2 changed files with 16 additions and 3 deletions

View file

@ -3371,6 +3371,17 @@ FxExpression *FxCompareEq::Resolve(FCompileContext& ctx)
{
Promote(ctx);
}
// allows comparing state labels with null pointers.
else if (left->ValueType == TypeStateLabel && right->ValueType == TypeNullPtr)
{
right = new FxTypeCast(right, TypeStateLabel, false);
SAFE_RESOLVE(right, ctx);
}
else if (right->ValueType == TypeStateLabel && left->ValueType == TypeNullPtr)
{
left = new FxTypeCast(left, TypeStateLabel, false);
SAFE_RESOLVE(left, ctx);
}
else if (left->ValueType->GetRegType() == REGT_POINTER && right->ValueType->GetRegType() == REGT_POINTER)
{
if (left->ValueType != right->ValueType && right->ValueType != TypeNullPtr && left->ValueType != TypeNullPtr &&