Browse Source

* WebAssembly code generation fix in thlcgwasm.a_op_reg_reg_reg_checkoverflow, based on patch by Pierre (but simplified, to use a single block)

Nikolay Nikolov 3 years ago
parent
commit
8bea5dd41e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compiler/wasm32/hlcgcpu.pas

+ 2 - 0
compiler/wasm32/hlcgcpu.pas

@@ -1734,9 +1734,11 @@ implementation
               current_asmdata.getjumplabel(lab);
               current_asmdata.getjumplabel(lab);
               { can be optimized by removing duplicate xor'ing to convert dst from
               { can be optimized by removing duplicate xor'ing to convert dst from
                 signed to unsigned quadrant }
                 signed to unsigned quadrant }
+              list.concat(taicpu.op_none(a_block));
               a_cmp_reg_reg_label(list,size,OC_B,dst,src1,lab);
               a_cmp_reg_reg_label(list,size,OC_B,dst,src1,lab);
               a_cmp_reg_reg_label(list,size,OC_B,dst,src2,lab);
               a_cmp_reg_reg_label(list,size,OC_B,dst,src2,lab);
               a_op_const_stack(list,OP_XOR,s32inttype,1);
               a_op_const_stack(list,OP_XOR,s32inttype,1);
+              list.concat(taicpu.op_none(a_end_block));
               a_label(list,lab);
               a_label(list,lab);
             end;
             end;
           a_load_stack_reg(list,s32inttype,ovloc.register);
           a_load_stack_reg(list,s32inttype,ovloc.register);