diff --git a/utils/wasmbin/wasmbinwriter.pas b/utils/wasmbin/wasmbinwriter.pas index 8637e5388d..e4f01ae2f7 100644 --- a/utils/wasmbin/wasmbinwriter.pas +++ b/utils/wasmbin/wasmbinwriter.pas @@ -613,9 +613,11 @@ var u32 : LongWord; begin Val(operand, i32, err); - if err = 0 then - u32 := LongWord(i32) - else + if err = 0 then begin + WriteS( dst, i32, sizeof(i32)); + Result := true; + Exit; + end else Val(operand, u32, err); Result := (err = 0);