commit | 553b37ce4ff758d8cf80d48a21287526c92221c6 | [log] [tgz] |
---|---|---|
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Tue Dec 29 13:38:47 2020 -0300 |
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Tue Dec 29 13:38:47 2020 -0300 |
tree | 4125ebc4456f8974bf039ce1e2bcbfdfc3276dc0 | |
parent | 4bd10b6fe81c0a56eb9e01e24fba10e655966870 [diff] |
Do not insert nil values into tables
diff --git a/ltable.c b/ltable.c index e9410f9..e98bab7 100644 --- a/ltable.c +++ b/ltable.c
@@ -647,6 +647,8 @@ else if (unlikely(luai_numisnan(f))) luaG_runerror(L, "table index is NaN"); } + if (ttisnil(value)) + return; /* do not insert nil values */ mp = mainpositionTV(t, key); if (!isempty(gval(mp)) || isdummy(t)) { /* main position is taken? */ Node *othern;