Browse Source

Fix TNEW load forwarding with instable types.

Mike Pall 6 years ago
parent
commit
d4c0c6e17e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/lj_opt_mem.c

+ 2 - 1
src/lj_opt_mem.c

@@ -179,7 +179,8 @@ static TRef fwd_ahload(jit_State *J, IRRef xref)
 	}
 	ref = store->prev;
       }
-      lua_assert(ir->o != IR_TNEW || irt_isnil(fins->t));
+      if (ir->o == IR_TNEW && !irt_isnil(fins->t))
+	return 0;  /* Type instability in loop-carried dependency. */
       if (irt_ispri(fins->t)) {
 	return TREF_PRI(irt_type(fins->t));
       } else if (irt_isnum(fins->t) || (LJ_DUALNUM && irt_isint(fins->t)) ||