Explorar o código

Fix FOLD rule for string.sub(s, ...) == k.

Mike Pall %!s(int64=11) %!d(string=hai) anos
pai
achega
e15765186c
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/lj_opt_fold.c

+ 2 - 1
src/lj_opt_fold.c

@@ -1826,7 +1826,8 @@ LJFOLDF(merge_eqne_snew_kgc)
   if (len <= FOLD_SNEW_MAX_LEN) {
     IROp op = (IROp)fins->o;
     IRRef strref = fleft->op1;
-    lua_assert(IR(strref)->o == IR_STRREF);
+    if (IR(strref)->o != IR_STRREF)
+      return NEXTFOLD;
     if (op == IR_EQ) {
       emitir(IRTGI(IR_EQ), fleft->op2, lj_ir_kint(J, len));
       /* Caveat: fins/fleft/fright is no longer valid after emitir. */