diff --git a/src/box/box_lua.m b/src/box/box_lua.m index 91299246a703fbaf443a8f4890841657d7833860..a5264f68a6e8dd0164f6fb8579a6328d94ac8d02 100644 --- a/src/box/box_lua.m +++ b/src/box/box_lua.m @@ -977,7 +977,11 @@ port_lua_add_tuple(struct port *port, struct tuple *tuple, lua_State *L = port_lua(port)->L; @try { lbox_pushtuple(L, tuple); +#if defined(__clang__) + } @catch (...) { +#else /* defined(__clang__) */ } @catch (id allOthers) { +#endif tnt_raise(ClientError, :ER_PROC_LUA, lua_tostring(L, -1)); } } @@ -1316,7 +1320,11 @@ box_lua_execute(struct request *request, struct port *port) port_add_lua_multret(port, L); } @catch (tnt_Exception *e) { @throw; +#if defined(__clang__) + } @catch (...) { +#else /* !defined(__clang__) */ } @catch (id allOthers) { +#endif tnt_raise(ClientError, :ER_PROC_LUA, lua_tostring(L, -1)); } @finally { /* diff --git a/src/lua/init.m b/src/lua/init.m index c128c554b84248c3e557888f024a20993c8f0971..4e1d3334c5d67e3725de1443472be0a3a380d426 100644 --- a/src/lua/init.m +++ b/src/lua/init.m @@ -510,7 +510,11 @@ box_lua_fiber_run(va_list ap __attribute__((unused))) /* The fiber is detached, log the error. */ [e log]; } +#if defined(__clang__) + } @catch (...) { +#else /* !defined(__clang__) */ } @catch (id allOthers) { +#endif lua_settop(L, 1); /* * The error message is already there. @@ -972,7 +976,11 @@ lbox_pcall(struct lua_State *L) lua_pushstring(L, e->errmsg); } @catch (tnt_Exception *e) { @throw; +#if defined(__clang__) + } @catch (...) { +#else /* !defined(__clang__) */ } @catch (id allOthers) { +#endif lua_settop(L, 1); /* completion status */ lua_pushboolean(L, false); @@ -1112,7 +1120,11 @@ tarantool_lua_dostring(struct lua_State *L, const char *str) } @catch (tnt_Exception *e) { lua_pushstring(L, [e errmsg]); return 1; +#if defined(__clang__) + } @catch (...) { +#else /* !defined(__clang__) */ } @catch (id allOthers) { +#endif return 1; } return 0; diff --git a/src/lua/session.m b/src/lua/session.m index 3f007b13d7e93a80c2a9b140b45d359df8a111ab..a213e322dc6425f7703750979c59af21e06a2edd 100644 --- a/src/lua/session.m +++ b/src/lua/session.m @@ -114,7 +114,11 @@ lbox_session_run_trigger(void *param) lua_call(L, 0, 0); } @catch (tnt_Exception *e) { @throw; +#if defined(__clang__) + } @catch (...) { +#else /* !defined(__clang__) */ } @catch ( id allOthers ) { +#endif tnt_raise(ClientError, :ER_PROC_LUA, lua_tostring(L, -1)); } @finally { diff --git a/test/unit/objc_catchcxx.m b/test/unit/objc_catchcxx.m index 23fed813b15e27820b2c67d961da6e595a9e8160..c74e3c9f7efd2671b621a75059d29d4d5eef669b 100644 --- a/test/unit/objc_catchcxx.m +++ b/test/unit/objc_catchcxx.m @@ -8,7 +8,11 @@ int main() luaL_openlibs(L); @try { luaL_error(L, "test"); +#if defined(__clang__) + } @catch (...) { +#else /* !defined(__clang__) */ } @catch (id allOthers) { +#endif printf("exception handled\n"); } lua_close(L);