diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ce6f1f52c0b1498d93361351ae9605b1e8b5fa7..54ed75ac79dc2cfb836e16d751f1dc7c9280852a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,9 +236,9 @@ endif() # usable on a system which has only gcc 4.1, statically link with # builtin libgcc by default. # -if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG) - add_compile_flags("C;CXX;OBJC;OBJCXX" "-static-libgcc") -endif() +#if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG) +# add_compile_flags("C;CXX;OBJC;OBJCXX" "-static-libgcc") +#endif() ## ## Third-Party libraries diff --git a/src/box/box_lua.cc b/src/box/box_lua.cc index 9c5a286e9405f0e2b02680cd8b3b81732d45ce9b..b811f9585afe8545673ed7a6218387edf786cb60 100644 --- a/src/box/box_lua.cc +++ b/src/box/box_lua.cc @@ -1713,10 +1713,10 @@ box_unpack_response(struct lua_State *L, const void *s, const void *end) t->field_count = field_count; memcpy(t->data, s, bsize); - s += bsize; + s = (const char *) s + bsize; lbox_pushtuple(L, t); } - return s; + return (const char *) s; } diff --git a/src/fiber.cc b/src/fiber.cc index 8894a8b7ec0c2878256c0f01bf21962b863aeb56..d8c3faf04bc59392fb72cb17f2db9822f6190f94 100644 --- a/src/fiber.cc +++ b/src/fiber.cc @@ -92,7 +92,7 @@ void fiber_checkstack() { if (sp + 1 - call_stack >= FIBER_CALL_STACK) - tnt_raise(ClientError, :ER_FIBER_STACK); + tnt_raise(ClientError, ER_FIBER_STACK); } /** Interrupt a synchronous wait of a fiber inside the event loop. diff --git a/src/lua/cjson.cc b/src/lua/cjson.cc index 45dd508511995d96790365d75fe555049653697d..59dc450b07592e407869598148bcda91aa5cce5f 100644 --- a/src/lua/cjson.cc +++ b/src/lua/cjson.cc @@ -32,9 +32,9 @@ extern "C" { #include "lua.h" #include "lauxlib.h" #include "lualib.h" +int luaopen_cjson(lua_State *l); } -int luaopen_cjson(lua_State *l); int tarantool_lua_cjson_init(struct lua_State *L) diff --git a/src/lua/init.cc b/src/lua/init.cc index b2b3a72a50dbe586c84fbc4b689b9ab3ce8931c4..e78dfcd67b5aed593b22ba64e77a2af249a238b4 100644 --- a/src/lua/init.cc +++ b/src/lua/init.cc @@ -665,18 +665,23 @@ box_lua_fiber_run_detached(va_list ap) { int coro_ref = va_arg(ap, int); struct lua_State *L = va_arg(ap, struct lua_State *); - @try { + auto cleanup = [=] { + luaL_unref(L, LUA_REGISTRYINDEX, coro_ref); + }; + try { lua_call(L, lua_gettop(L) - 1, LUA_MULTRET); - } @catch (FiberCancelException *e) { - @throw; - } @catch (tnt_Exception *e) { - [e log]; - } @catch (id allOthers) { + cleanup(); + } catch (const FiberCancelException &e) { + throw; + cleanup(); + } catch (const Exception &e) { + e.log(); + cleanup(); + } catch (...) { lua_settop(L, 1); if (lua_tostring(L, -1) != NULL) say_error("%s", lua_tostring(L, -1)); - } @finally { - luaL_unref(L, LUA_REGISTRYINDEX, coro_ref); + cleanup(); } }