Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Maria Khaydich" <maria.khaydich@tarantool.org>
To: tarantool-patches <tarantool-patches@dev.tarantool.org>,
	"Alexander Turenko" <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH] box: remove context from stack
Date: Tue, 09 Jun 2020 13:35:18 +0300	[thread overview]
Message-ID: <1591698918.771792066@f423.i.mail.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

I suppose no tests are needed since this one is pretty straightforward.
Lua stack was broken because we forgot to clear the context
in case of an error when return value of called function was
not serializable.
Closes #4617
Remove context from lua stack in case of an error.
 src/box/lua/call.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/src/box/lua/call.c b/src/box/lua/call.c
index 6588ec2fa..7ab49983d 100644
--- a/src/box/lua/call.c
+++ b/src/box/lua/call.c
@@ -436,6 +436,7 @@ port_lua_do_dump(struct port *base, struct mpstream *stream,
     int top = lua_gettop(L);
     if (lua_cpcall(L, handler, &ctx) != 0) {
+        lua_pop(L, 1); 
         return -1;
     lua_settop(L, top);

[-- Attachment #2: Type: text/html, Size: 1512 bytes --]

             reply	other threads:[~2020-06-09 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 10:35 Maria Khaydich [this message]
2021-07-01 12:34 ` Alexander Turenko via Tarantool-patches
2021-09-07 12:40   ` Sergey Kaplun via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591698918.771792066@f423.i.mail.ru \
    --to=maria.khaydich@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box: remove context from stack' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox