- ZScript: fixed integer type promotion for shift operator

* the first operand must never be sign-changed.
* the second operand should always be made unsigned. Shift by negative values is undefined and may produce undefined behavior on some systems.
This commit is contained in:
Christoph Oelckers 2022-08-03 09:03:03 +02:00
commit 388a5cb481
2 changed files with 7 additions and 6 deletions

View file

@ -910,7 +910,7 @@ public:
FxBinary(int, FxExpression*, FxExpression*);
~FxBinary();
bool Promote(FCompileContext &ctx, bool forceint = false);
bool Promote(FCompileContext &ctx, bool forceint = false, bool shiftop = false);
};
//==========================================================================