From 811e448daa0f8f06e946fb607a98ace85c43b574 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 28 Nov 2024 16:26:10 +0100 Subject: [PATCH] Fix detection of inconsistent renames due to sunk values. Thanks to Sergey Kaplun. #1295 #584 --- src/lj_asm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lj_asm.c b/src/lj_asm.c index 7c4d8f52..c217609b 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c @@ -826,11 +826,11 @@ static int asm_sunk_store(ASMState *as, IRIns *ira, IRIns *irs) static void asm_snap_alloc1(ASMState *as, IRRef ref) { IRIns *ir = IR(ref); - if (!irref_isk(ref) && ir->r != RID_SUNK) { + if (!irref_isk(ref)) { bloomset(as->snapfilt1, ref); bloomset(as->snapfilt2, hashrot(ref, ref + HASH_BIAS)); if (ra_used(ir)) return; - if (ir->r == RID_SINK) { + if (ir->r == RID_SINK || ir->r == RID_SUNK) { ir->r = RID_SUNK; #if LJ_HASFFI if (ir->o == IR_CNEWI) { /* Allocate CNEWI value. */