Pārlūkot izejas kodu

* WebAssembly: stop with internal error in case the code generator is requested to a binary operation with two different sized registers

Nikolay Nikolov 4 dienas atpakaļ
vecāks
revīzija
cfcba50385
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      compiler/wasm32/hlcgcpu.pas

+ 5 - 1
compiler/wasm32/hlcgcpu.pas

@@ -1836,7 +1836,11 @@ implementation
   procedure thlcgwasm.a_op_reg_reg_reg(list: TAsmList; op: TOpCg; size: tdef; src1, src2, dst: tregister);
     begin
       if not(op in [OP_NOT,OP_NEG]) then
-        a_load_reg_stack(list,size,src2);
+        begin
+          a_load_reg_stack(list,size,src2);
+          if getsubreg(src1)<>getsubreg(src2) then
+            internalerror(2025100701);
+        end;
       a_op_reg_stack(list,op,size,src1);
       a_load_stack_reg(list,size,dst);
     end;