Revert "- fixed some uses of postincre,ment/decrements on narrow types."

This reverts commit 668f8f2cf6.

Revert "- added a proper error message when '--' or '++' gets used on 8 or 16 bit values."

This reverts commit a94f5dd1b3.

None of this was necessary - the triggered assert was bogus and had to be removed.
This commit is contained in:
Christoph Oelckers 2021-05-17 18:13:30 +02:00
commit 97b8c0ccfb
5 changed files with 10 additions and 18 deletions

View file

@ -2145,9 +2145,9 @@ FxExpression *FxPreIncrDecr::Resolve(FCompileContext &ctx)
ValueType = Base->ValueType;
if (!Base->IsNumeric() || Base->ValueType->Size != 4)
if (!Base->IsNumeric())
{
ScriptPosition.Message(MSG_ERROR, "Numeric 32 bit type expected");
ScriptPosition.Message(MSG_ERROR, "Numeric type expected");
delete this;
return nullptr;
}
@ -2170,7 +2170,6 @@ FxExpression *FxPreIncrDecr::Resolve(FCompileContext &ctx)
ExpEmit FxPreIncrDecr::Emit(VMFunctionBuilder *build)
{
assert(Token == TK_Incr || Token == TK_Decr);
assert(ValueType == Base->ValueType && IsNumeric());
int zero = build->GetConstantInt(0);
int regtype = ValueType->GetRegType();
@ -2232,9 +2231,9 @@ FxExpression *FxPostIncrDecr::Resolve(FCompileContext &ctx)
ValueType = Base->ValueType;
if (!Base->IsNumeric() || ValueType->Size != 4)
if (!Base->IsNumeric())
{
ScriptPosition.Message(MSG_ERROR, "Numeric 32 bit type expected");
ScriptPosition.Message(MSG_ERROR, "Numeric type expected");
delete this;
return nullptr;
}
@ -2257,7 +2256,6 @@ FxExpression *FxPostIncrDecr::Resolve(FCompileContext &ctx)
ExpEmit FxPostIncrDecr::Emit(VMFunctionBuilder *build)
{
assert(Token == TK_Incr || Token == TK_Decr);
assert(ValueType == Base->ValueType && IsNumeric());
int zero = build->GetConstantInt(0);
int regtype = ValueType->GetRegType();