Browse Source

* fixed OS_S8 to OS_16 conversion for WebAssembly. This fixes test/cg/tcnvint6

Nikolay Nikolov 3 years ago
parent
commit
cc2fa67dfa
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/wasm32/hlcgcpu.pas

+ 5 - 1
compiler/wasm32/hlcgcpu.pas

@@ -2361,7 +2361,11 @@ implementation
                 OS_8:
                   a_op_const_stack(list,OP_AND,s32inttype,255);
                 OS_S8:
-                  list.concat(taicpu.op_none(a_i32_extend8_s));
+                  begin
+                    list.concat(taicpu.op_none(a_i32_extend8_s));
+                    if tocgsize=OS_16 then
+                      a_op_const_stack(list,OP_AND,s32inttype,65535);
+                  end;
                 OS_16:
                   a_op_const_stack(list,OP_AND,s32inttype,65535);
                 OS_S16: