Ver código fonte

Fix compilation with FFI disabled.

Mike Pall 13 anos atrás
pai
commit
cf3a263044
2 arquivos alterados com 5 adições e 3 exclusões
  1. 2 2
      src/lj_asm.c
  2. 3 1
      src/lj_lex.c

+ 2 - 2
src/lj_asm.c

@@ -808,9 +808,9 @@ static void asm_snap_alloc1(ASMState *as, IRRef ref)
 	asm_snap_alloc1(as, ir->op2);
 	if (LJ_32 && (ir+1)->o == IR_HIOP)
 	  asm_snap_alloc1(as, (ir+1)->op2);
-      }
+      } else
 #endif
-      else {  /* Allocate stored values for TNEW, TDUP and CNEW. */
+      {  /* Allocate stored values for TNEW, TDUP and CNEW. */
 	IRIns *irs;
 	lua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW);
 	for (irs = IR(as->snapref-1); irs > ir; irs--)

+ 3 - 1
src/lj_lex.c

@@ -108,7 +108,8 @@ static void lex_number(LexState *ls, TValue *tv)
     setitype(tv, LJ_TISNUM);
   } else if (fmt == STRSCAN_NUM) {
     /* Already in correct format. */
-  } else if (LJ_HASFFI && fmt != STRSCAN_ERROR) {
+#if LJ_HASFFI
+  } else if (fmt != STRSCAN_ERROR) {
     lua_State *L = ls->L;
     GCcdata *cd;
     lua_assert(fmt == STRSCAN_I64 || fmt == STRSCAN_U64 || fmt == STRSCAN_IMAG);
@@ -126,6 +127,7 @@ static void lex_number(LexState *ls, TValue *tv)
       *(uint64_t *)cdataptr(cd) = tv->u64;
     }
     lj_parse_keepcdata(ls, tv, cd);
+#endif
   } else {
     lua_assert(fmt == STRSCAN_ERROR);
     lj_lex_error(ls, TK_number, LJ_ERR_XNUMBER);