35#define MAXTAGLOOP 2000
44#if !defined(l_intfitsf)
47#define NBM (l_mathlim(MANT_DIG))
56#if ((((LUA_MAXINTEGER >> (NBM / 4)) >> (NBM / 4)) >> (NBM / 4)) \
57 >> (NBM - (3 * (NBM / 4)))) > 0
59#define l_intfitsf(i) \
60 (-((lua_Integer)1 << NBM) <= (i) && (i) <= ((lua_Integer)1 << NBM))
101 if (mode == 0)
return 0;
144 if (step < 0) *stopnow = 1;
148 if (step >= 0) *stopnow = 1;
237 luaG_runerror(L,
"'__newindex' chain too long; possible loop");
249 const char *l =
getstr(ls);
251 const char *r =
getstr(rs);
254 int temp = strcoll(l, r);
258 size_t len = strlen(l);
260 return (len == ll) ? 0 : 1;
265 l += len; ll -= len; r += len; lr -= len;
282#if defined(l_intfitsf)
286 else if (f >
cast_num(LUA_MININTEGER))
301#if defined(l_intfitsf)
305 else if (f >=
cast_num(LUA_MININTEGER))
429 else if (L ==
NULL)
return 0;
437 else if (L ==
NULL)
return 0;
454#define tostring(L,o) \
455 (ttisstring(o) || (cvt2str(o) && (luaO_tostring(L, o), 1)))
457#define isemptystr(o) (ttisshrstring(o) && tsvalue(o)->shrlen == 0)
463 size_t l =
vslen(top - n);
464 memcpy(buff + tl,
svalue(top - n), l *
sizeof(
char));
488 size_t tl =
vslen(top - 1);
491 for (n = 1; n < total &&
tostring(L, top - n - 1); n++) {
492 size_t l =
vslen(top - n - 1);
493 if (l >= (
MAX_SIZE/
sizeof(
char)) - tl)
556 return intop(-, 0, m);
560 if ((m ^ n) < 0 && m % n != 0)
580 if (r != 0 && (m ^ n) < 0)
588#define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT)
595 if (y <= -
NBITS)
return 0;
596 else return intop(>>, x, -y);
599 if (y >=
NBITS)
return 0;
600 else return intop(<<, x, y);
616 for (i = 0; i < nup; i++) {
640 for (i = 0; i < nup; i++) {
686 int total =
cast_int(top - 1 - (base + b));
728#define RA(i) (base+GETARG_A(i))
729#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))
730#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))
731#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \
732 ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))
733#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \
734 ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))
738#define dojump(ci,i,e) \
739 { int a = GETARG_A(i); \
740 if (a != 0) luaF_close(L, ci->u.l.base + a - 1); \
741 ci->u.l.savedpc += GETARG_sBx(i) + e; }
744#define donextjump(ci) { i = *ci->u.l.savedpc; dojump(ci, i, 1); }
747#define Protect(x) { {x;}; base = ci->u.l.base; }
749#define checkGC(L,c) \
750 { luaC_condGC(L, L->top = (c), \
751 Protect(L->top = ci->top)); \
752 luai_threadyield(L); }
757 i = *(ci->u.l.savedpc++); \
758 if (L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) \
759 Protect(luaG_traceexec(L)); \
761 lua_assert(base == ci->u.l.base); \
762 lua_assert(base <= L->top && L->top < L->stack + L->stacksize); \
765#define vmdispatch(o) switch(o)
766#define vmcase(l) case l:
774#define gettableProtected(L,t,k,v) { const TValue *slot; \
775 if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \
776 else Protect(luaV_finishget(L,t,k,v,slot)); }
780#define settableProtected(L,t,k,v) { const TValue *slot; \
781 if (!luaV_fastset(L,t,k,slot,luaH_get,v)) \
782 Protect(luaV_finishset(L,t,k,v,slot)); }
872 if (b != 0 || c != 0)
1071 L->
top = base + c + 1;
1076 checkGC(L, (ra >= rb ? ra + 1 : rb));
1133 if (b != 0) L->
top = ra+b;
1147 if (b != 0) L->
top = ra+b;
1164 for (aux = 0; nfunc + aux < lim; aux++)
1167 oci->
top = L->
top = ofunc + (L->
top - nfunc);
1195 if ((0 < step) ? (idx <= limit) : (limit <= idx)) {
1277 for (; n > 0; n--) {
1307 for (j = 0; j < b && j < n; j++)
void luaG_runerror(lua_State *L, const char *fmt,...)
int luaG_ordererror(lua_State *L, const TValue *p1, const TValue *p2)
void luaG_typeerror(lua_State *L, const TValue *o, const char *op)
int luaD_precall(lua_State *L, StkId func, int nresults)
void luaD_call(lua_State *L, StkId func, int nResults)
int luaD_poscall(lua_State *L, StkId firstResult)
#define luaD_checkstack(L, n)
Closure * luaF_newLclosure(lua_State *L, int nelems, Table *e)
UpVal * luaF_findupval(lua_State *L, StkId level)
void luaF_close(lua_State *L, StkId level)
#define setbvalue(obj, x)
#define sethvalue(L, obj, x)
#define setobj(L, obj1, obj2)
#define LFIELDS_PER_FLUSH
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
const TValue * luaH_get(Table *t, const TValue *key)
Table * luaH_new(lua_State *L, int narray, int nhash)
const TValue * luaH_getstr(Table *t, TString *key)
void luaH_resizearray(lua_State *L, Table *t, int nasize)
const TValue * luaT_gettmbyobj(lua_State *L, const TValue *o, TMS event)
#define LUA_TLIGHTUSERDATA
#define luaC_barrierback(L, p, v)
#define setclLvalue(L, obj, x)
int luaS_eqlngstr(TString *a, TString *b)
void luaH_resize(lua_State *L, Table *t, int nasize, int nhsize)
void luaH_setint(lua_State *L, Table *t, int key, TValue *value)
TValue * luaH_newkey(lua_State *L, Table *t, const TValue *key)
#define invalidateTMcache(t)
#define luaC_upvalbarrier(L, uv)
#define luai_nummul(L, a, b)
#define luai_numdiv(L, a, b)
#define luai_numpow(L, a, b)
#define luai_numunm(L, a)
#define luai_numsub(L, a, b)
#define luai_numidiv(L, a, b)
#define luai_nummod(L, a, b, m)
#define luai_numadd(L, a, b)
size_t luaO_str2num(const char *s, TValue *o)
#define chgivalue(obj, x)
#define setfltvalue(obj, x)
#define setivalue(obj, x)
#define chgfltvalue(obj, x)
TString * luaS_createlngstrobj(lua_State *L, size_t l)
void luaT_trybinTM(lua_State *L, const TValue *p1, const TValue *p2, StkId res, TMS event)
void luaT_callTM(lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, TValue *p3, int hasres)
int luaT_callorderTM(lua_State *L, const TValue *p1, const TValue *p2, TMS event)
#define lua_numbertointeger(n, p)
int luaV_lessequal(lua_State *L, const TValue *l, const TValue *r)
static int LTnum(const TValue *l, const TValue *r)
void luaV_concat(lua_State *L, int total)
void luaV_finishget(lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
int luaV_equalobj(lua_State *L, const TValue *t1, const TValue *t2)
static void pushclosure(lua_State *L, Proto *p, UpVal **encup, StkId base, StkId ra)
static int forlimit(const TValue *obj, lua_Integer *p, lua_Integer step, int *stopnow)
#define settableProtected(L, t, k, v)
static void copy2buff(StkId top, int n, char *buff)
int luaV_lessthan(lua_State *L, const TValue *l, const TValue *r)
void luaV_finishOp(lua_State *L)
lua_Integer luaV_div(lua_State *L, lua_Integer m, lua_Integer n)
#define gettableProtected(L, t, k, v)
static int LEnum(const TValue *l, const TValue *r)
void luaV_objlen(lua_State *L, StkId ra, const TValue *rb)
static int LEintfloat(lua_Integer i, lua_Number f)
void luaV_finishset(lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
void luaV_execute(lua_State *L)
static LClosure * getcached(Proto *p, UpVal **encup, StkId base)
int luaV_tointeger(const TValue *obj, lua_Integer *p, int mode)
lua_Integer luaV_shiftl(lua_Integer x, lua_Integer y)
int luaV_tonumber_(const TValue *obj, lua_Number *n)
static int LTintfloat(lua_Integer i, lua_Number f)
lua_Integer luaV_mod(lua_State *L, lua_Integer m, lua_Integer n)
static int l_strcmp(const TString *ls, const TString *rs)
#define luaV_fastget(L, t, k, slot, f)
#define luaV_fastset(L, t, k, slot, f, v)
#define intop(op, v1, v2)
struct CallInfo * previous
struct CallInfo::@64::@65 l
const Instruction * savedpc