aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-09-11 08:39:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-09-11 08:39:12 -0300
commit9cbf17b0f1bb4001b237c4027b271f0db9bde62c (patch)
tree22f7efcbec00a08d7204c0b3d3cc4968d3535798
parent5382a22e0eea878339c504b2a9a3b36bcd839fcc (diff)
downloadlua-9cbf17b0f1bb4001b237c4027b271f0db9bde62c.tar.gz
lua-9cbf17b0f1bb4001b237c4027b271f0db9bde62c.tar.bz2
lua-9cbf17b0f1bb4001b237c4027b271f0db9bde62c.zip
Details (comments)
-rw-r--r--lapi.c6
-rw-r--r--llimits.h5
-rw-r--r--lparser.c4
3 files changed, 11 insertions, 4 deletions
diff --git a/lapi.c b/lapi.c
index 0ca9a321..ae6b07ae 100644
--- a/lapi.c
+++ b/lapi.c
@@ -38,7 +38,11 @@ const char lua_ident[] =
38 38
39 39
40 40
41/* test for a valid index */ 41/*
42** Test for a valid index.
43** '!ttisnil(o)' implies 'o != &G(L)->nilvalue', so it is not needed.
44** However, it covers the most common cases in a faster way.
45*/
42#define isvalid(L, o) (!ttisnil(o) || o != &G(L)->nilvalue) 46#define isvalid(L, o) (!ttisnil(o) || o != &G(L)->nilvalue)
43 47
44 48
diff --git a/llimits.h b/llimits.h
index e91310a0..8ab58b5c 100644
--- a/llimits.h
+++ b/llimits.h
@@ -298,7 +298,10 @@ typedef unsigned long Instruction;
298** so it is better to use 'fmod'. 'fmod' gives the result of 298** so it is better to use 'fmod'. 'fmod' gives the result of
299** 'a - trunc(a/b)*b', and therefore must be corrected when 299** 'a - trunc(a/b)*b', and therefore must be corrected when
300** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a 300** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a
301** non-integer negative result, which is equivalent to the tests below. 301** non-integer negative result: non-integer result is equivalent to
302** a non-zero remainder 'm'; negative result is equivalent to 'a' and
303** 'b' with different signs, or 'm' and 'b' with different signs
304** (as the result 'm' of 'fmod' has the same sign of 'a').
302*/ 305*/
303#if !defined(luai_nummod) 306#if !defined(luai_nummod)
304#define luai_nummod(L,a,b,m) \ 307#define luai_nummod(L,a,b,m) \
diff --git a/lparser.c b/lparser.c
index 9f156dd9..32500b02 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1171,9 +1171,9 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
1171 suffixedexp(ls, &nv.v); 1171 suffixedexp(ls, &nv.v);
1172 if (!vkisindexed(nv.v.k)) 1172 if (!vkisindexed(nv.v.k))
1173 check_conflict(ls, lh, &nv.v); 1173 check_conflict(ls, lh, &nv.v);
1174 luaE_incCcalls(ls->L); /* control recursion depth */ 1174 enterlevel(ls); /* control recursion depth */
1175 assignment(ls, &nv, nvars+1); 1175 assignment(ls, &nv, nvars+1);
1176 ls->L->nCcalls--; 1176 leavelevel(ls);
1177 } 1177 }
1178 else { /* assignment -> '=' explist */ 1178 else { /* assignment -> '=' explist */
1179 int nexps; 1179 int nexps;