]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix detection of inconsistent renames due to sunk values.
authorMike Pall <mike>
Thu, 28 Nov 2024 15:26:10 +0000 (16:26 +0100)
committerMike Pall <mike>
Thu, 28 Nov 2024 15:26:10 +0000 (16:26 +0100)
Thanks to Sergey Kaplun. #1295 #584

src/lj_asm.c

index 7c4d8f52775f9bbe62581657fe28e4c87f283cfe..c217609b1db4d0d0e283cff2586dce533823cbe8 100644 (file)
@@ -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. */