From d3294fa63b344173db68dd612c6d3801631e28d4 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sat, 2 Oct 2021 16:52:57 +0200 Subject: [PATCH] MIPS: Fix register allocation in assembly of HREF. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by Jakub Piotr Cłapa. --- src/lj_asm_mips.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index b55596e6..ee81e5e0 100644 --- a/src/lj_asm_mips.h +++ b/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); }