Details (comments)
This commit is contained in:
6
lapi.c
6
lapi.c
@@ -38,7 +38,11 @@ const char lua_ident[] =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* test for a valid index */
|
/*
|
||||||
|
** Test for a valid index.
|
||||||
|
** '!ttisnil(o)' implies 'o != &G(L)->nilvalue', so it is not needed.
|
||||||
|
** However, it covers the most common cases in a faster way.
|
||||||
|
*/
|
||||||
#define isvalid(L, o) (!ttisnil(o) || o != &G(L)->nilvalue)
|
#define isvalid(L, o) (!ttisnil(o) || o != &G(L)->nilvalue)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -298,7 +298,10 @@ typedef unsigned long Instruction;
|
|||||||
** so it is better to use 'fmod'. 'fmod' gives the result of
|
** so it is better to use 'fmod'. 'fmod' gives the result of
|
||||||
** 'a - trunc(a/b)*b', and therefore must be corrected when
|
** 'a - trunc(a/b)*b', and therefore must be corrected when
|
||||||
** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a
|
** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a
|
||||||
** non-integer negative result, which is equivalent to the tests below.
|
** non-integer negative result: non-integer result is equivalent to
|
||||||
|
** a non-zero remainder 'm'; negative result is equivalent to 'a' and
|
||||||
|
** 'b' with different signs, or 'm' and 'b' with different signs
|
||||||
|
** (as the result 'm' of 'fmod' has the same sign of 'a').
|
||||||
*/
|
*/
|
||||||
#if !defined(luai_nummod)
|
#if !defined(luai_nummod)
|
||||||
#define luai_nummod(L,a,b,m) \
|
#define luai_nummod(L,a,b,m) \
|
||||||
|
|||||||
@@ -1171,9 +1171,9 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
|
|||||||
suffixedexp(ls, &nv.v);
|
suffixedexp(ls, &nv.v);
|
||||||
if (!vkisindexed(nv.v.k))
|
if (!vkisindexed(nv.v.k))
|
||||||
check_conflict(ls, lh, &nv.v);
|
check_conflict(ls, lh, &nv.v);
|
||||||
luaE_incCcalls(ls->L); /* control recursion depth */
|
enterlevel(ls); /* control recursion depth */
|
||||||
assignment(ls, &nv, nvars+1);
|
assignment(ls, &nv, nvars+1);
|
||||||
ls->L->nCcalls--;
|
leavelevel(ls);
|
||||||
}
|
}
|
||||||
else { /* assignment -> '=' explist */
|
else { /* assignment -> '=' explist */
|
||||||
int nexps;
|
int nexps;
|
||||||
|
|||||||
Reference in New Issue
Block a user