ソースを参照

MIPS: Fix register allocation in assembly of HREF.

Reported by Jakub Piotr Cłapa.
Mike Pall 4 年 前
コミット
d3294fa63b
1 ファイル変更5 行追加3 行削除
  1. 5 3
      src/lj_asm_mips.h

+ 5 - 3
src/lj_asm_mips.h

@@ -643,9 +643,11 @@ static void asm_href(ASMState *as, IRIns *ir)
   if (irt_isnum(kt)) {
     key = ra_alloc1(as, refkey, RSET_FPR);
     tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key));
-  } else if (!irt_ispri(kt)) {
-    key = ra_alloc1(as, refkey, allow);
-    rset_clear(allow, key);
+  } else {
+    if (!irt_ispri(kt)) {
+      key = ra_alloc1(as, refkey, allow);
+      rset_clear(allow, key);
+    }
     type = ra_allock(as, irt_toitype(irkey->t), allow);
     rset_clear(allow, type);
   }