mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-14 05:52:02 +00:00
Switch signed/unsigned instructions when upcasting 32- to 64-bit integers, fixes #247
Matches C semantics now. Turns around some instructions in tests, especially libm, but doesn't break anything.
This commit is contained in:
@ -2641,7 +2641,7 @@ export class Compiler extends DiagnosticEmitter {
|
||||
// i32 or smaller to i64
|
||||
} else if (toType.is(TypeFlags.LONG)) {
|
||||
expr = module.createUnary(
|
||||
toType.is(TypeFlags.SIGNED) ? UnaryOp.ExtendI32 : UnaryOp.ExtendU32,
|
||||
fromType.is(TypeFlags.SIGNED) ? UnaryOp.ExtendI32 : UnaryOp.ExtendU32,
|
||||
this.ensureSmallIntegerWrap(expr, fromType) // must clear garbage bits
|
||||
);
|
||||
wrapMode = WrapMode.NONE;
|
||||
|
Reference in New Issue
Block a user