From 41b447d41ae47e45d9610b53be68de67535aee36 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Wed, 1 Apr 2015 12:18:49 +0800 Subject: [PATCH] update sproto: check table --- lualib-src/sproto/lsproto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lualib-src/sproto/lsproto.c b/lualib-src/sproto/lsproto.c index 7ed70d18..cb655e3e 100644 --- a/lualib-src/sproto/lsproto.c +++ b/lualib-src/sproto/lsproto.c @@ -121,6 +121,9 @@ encode(const struct sproto_arg *args) { self->array_index = 0; return 0; } + if (!lua_istable(L, -1)) { + return luaL_error(L, "%s is not a table", args->tagname); + } if (self->array_index) { lua_replace(L, self->array_index); } else {