From c3cf6bd022fff2b7d5f4f1a7b64699f3c63c58dd Mon Sep 17 00:00:00 2001 From: Daniel Wallin Date: Tue, 10 Aug 2004 06:54:13 +0000 Subject: [PATCH] fixed LUABIND_NO_EXCEPTION problem in class_rep.cpp --- src/class_rep.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/class_rep.cpp b/src/class_rep.cpp index a60469f..9771bd0 100755 --- a/src/class_rep.cpp +++ b/src/class_rep.cpp @@ -682,16 +682,14 @@ int luabind::detail::class_rep::function_dispatcher(lua_State* L) const overload_rep& o = rep->overloads()[match_index]; - if (force_static_call) - { - if (!o.has_static()) - { - lua_pushstring(L, "pure virtual function called"); - throw error(L); - } + if (force_static_call && !o.has_static()) + { + lua_pushstring(L, "pure virtual function called"); } - - return o.call(L, force_static_call != 0); + else + { + return o.call(L, force_static_call != 0); + } #ifndef LUABIND_NO_EXCEPTIONS @@ -715,12 +713,12 @@ int luabind::detail::class_rep::function_dispatcher(lua_State* L) msg += "() threw an exception"; lua_pushstring(L, msg.c_str()); } - // we can only reach this line if an exception was thrown - lua_error(L); - return 0; // will never be reached #endif - + + // we can only reach this line if an error occured + lua_error(L); + return 0; // will never be reached } #ifndef NDEBUG -- 2.11.4.GIT