diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib_table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib_table.c b/src/lib_table.c index 4f5d9d0d..80c7c8dc 100644 --- a/src/lib_table.c +++ b/src/lib_table.c | |||
@@ -134,8 +134,8 @@ LJLIB_CF(table_concat) LJLIB_REC(.) | |||
134 | GCtab *t = lj_lib_checktab(L, 1); | 134 | GCtab *t = lj_lib_checktab(L, 1); |
135 | GCstr *sep = lj_lib_optstr(L, 2); | 135 | GCstr *sep = lj_lib_optstr(L, 2); |
136 | int32_t i = lj_lib_optint(L, 3, 1); | 136 | int32_t i = lj_lib_optint(L, 3, 1); |
137 | int32_t e = L->base+3 < L->top ? lj_lib_checkint(L, 4) : | 137 | int32_t e = (L->base+3 < L->top && !tvisnil(L->base+3)) ? |
138 | (int32_t)lj_tab_len(t); | 138 | lj_lib_checkint(L, 4) : (int32_t)lj_tab_len(t); |
139 | SBuf *sb = lj_buf_tmp_(L); | 139 | SBuf *sb = lj_buf_tmp_(L); |
140 | SBuf *sbx = lj_buf_puttab(sb, t, sep, i, e); | 140 | SBuf *sbx = lj_buf_puttab(sb, t, sep, i, e); |
141 | if (LJ_UNLIKELY(!sbx)) { /* Error: bad element type. */ | 141 | if (LJ_UNLIKELY(!sbx)) { /* Error: bad element type. */ |