diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-11-13 16:40:08 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-11-13 16:40:08 +0100 |
commit | 98553f7f1fa3b19bb1e1756c15776cef522bae99 (patch) | |
tree | 0e39fc029aec8040e1195b025d94a9d67dda8b88 /src/tools.c | |
parent | a204c64b11ea96fe99aab17ffa7484372e1b2a26 (diff) | |
download | lanes-98553f7f1fa3b19bb1e1756c15776cef522bae99.tar.gz lanes-98553f7f1fa3b19bb1e1756c15776cef522bae99.tar.bz2 lanes-98553f7f1fa3b19bb1e1756c15776cef522bae99.zip |
Fix a case where an error could be raised inside a keeper state
Diffstat (limited to 'src/tools.c')
-rw-r--r-- | src/tools.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools.c b/src/tools.c index f9b34be..0c07a3b 100644 --- a/src/tools.c +++ b/src/tools.c | |||
@@ -1593,7 +1593,8 @@ static void lookup_native_func( lua_State* L2, lua_State* L, uint_t i, enum eLoo | |||
1593 | from = lua_tostring( L, -1); | 1593 | from = lua_tostring( L, -1); |
1594 | lua_getglobal( L2, "decoda_name"); // {} f decoda_name | 1594 | lua_getglobal( L2, "decoda_name"); // {} f decoda_name |
1595 | to = lua_tostring( L2, -1); | 1595 | to = lua_tostring( L2, -1); |
1596 | (void) luaL_error( L, "%s: function '%s' not found in %s destination transfer database.", from ? from : "main", fqn, to ? to : "main"); | 1596 | // when mode_ == eLM_FromKeeper, L is a keeper state and L2 is not, therefore L2 is the state where we want to raise the error |
1597 | (void) luaL_error( (mode_ == eLM_FromKeeper) ? L2 : L, "%s: function '%s' not found in %s destination transfer database.", from ? from : "main", fqn, to ? to : "main"); | ||
1597 | return; | 1598 | return; |
1598 | } | 1599 | } |
1599 | lua_remove( L2, -2); // f | 1600 | lua_remove( L2, -2); // f |