aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2013-05-08 11:05:43 +0200
committerMike Pall <mike>2013-05-08 11:05:43 +0200
commitb03078840100953cff6076dedb5e9a4c1ec12317 (patch)
tree59bfee8faba74ddcbaac65670f24ec1069403361
parentc5d7666ec82380ad1fe7be0511654fc44af496b8 (diff)
downloadluajit-b03078840100953cff6076dedb5e9a4c1ec12317.tar.gz
luajit-b03078840100953cff6076dedb5e9a4c1ec12317.tar.bz2
luajit-b03078840100953cff6076dedb5e9a4c1ec12317.zip
Fix optional argument handling in table.concat().
-rw-r--r--src/lib_table.c4
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 (;;) {