Bläddra i källkod

* Fixed random AVs when targeting the AVX FPU.

Yuriy Sydorov 3 år sedan
förälder
incheckning
e9acd759a4
2 ändrade filer med 3 tillägg och 0 borttagningar
  1. 2 0
      compiler/rgobj.pas
  2. 1 0
      compiler/x86/rgx86.pas

+ 2 - 0
compiler/rgobj.pas

@@ -1211,6 +1211,8 @@ unit rgobj;
     function trgobj.get_alias(n:Tsuperregister):Tsuperregister;
 
     begin
+      if n>=maxreg then
+        internalerror(2021121201);
       while ri_coalesced in reginfo[n].flags do
         n:=reginfo[n].alias;
       get_alias:=n;

+ 1 - 0
compiler/x86/rgx86.pas

@@ -200,6 +200,7 @@ implementation
                       { avx instructions allow only the first operand (at&t counting) to be a register operand
                         all operands must be registers ... }
                       else if (oper[0]^.typ=top_reg) and
+                         (getregtype(oper[0]^.reg)=regtype) and
                          (oper[1]^.typ=top_reg) and
                          (oper[2]^.typ=top_reg) and
                          { but they must be different }