|
@@ -148,8 +148,8 @@ LJLIB_CF(table_concat)
|
|
|
GCstr *sep = lj_lib_optstr(L, 2);
|
|
|
MSize seplen = sep ? sep->len : 0;
|
|
|
int32_t i = lj_lib_optint(L, 3, 1);
|
|
|
- int32_t e = L->base+3 < L->top ? lj_lib_checkint(L, 4) :
|
|
|
- (int32_t)lj_tab_len(t);
|
|
|
+ int32_t e = (L->base+3 < L->top && !tvisnil(L->base+3)) ?
|
|
|
+ lj_lib_checkint(L, 4) : (int32_t)lj_tab_len(t);
|
|
|
luaL_buffinit(L, &b);
|
|
|
if (i <= e) {
|
|
|
for (;;) {
|