diff options
-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 8d53a6cd..542ed1f8 100644 --- a/src/lib_table.c +++ b/src/lib_table.c | |||
@@ -148,8 +148,8 @@ LJLIB_CF(table_concat) | |||
148 | GCstr *sep = lj_lib_optstr(L, 2); | 148 | GCstr *sep = lj_lib_optstr(L, 2); |
149 | MSize seplen = sep ? sep->len : 0; | 149 | MSize seplen = sep ? sep->len : 0; |
150 | int32_t i = lj_lib_optint(L, 3, 1); | 150 | int32_t i = lj_lib_optint(L, 3, 1); |
151 | int32_t e = L->base+3 < L->top ? lj_lib_checkint(L, 4) : | 151 | int32_t e = (L->base+3 < L->top && !tvisnil(L->base+3)) ? |
152 | (int32_t)lj_tab_len(t); | 152 | lj_lib_checkint(L, 4) : (int32_t)lj_tab_len(t); |
153 | luaL_buffinit(L, &b); | 153 | luaL_buffinit(L, &b); |
154 | if (i <= e) { | 154 | if (i <= e) { |
155 | for (;;) { | 155 | for (;;) { |