aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Luamm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Luamm.cc')
-rw-r--r--src/FbTk/Luamm.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/FbTk/Luamm.cc b/src/FbTk/Luamm.cc
index 81a8fb3..d17096f 100644
--- a/src/FbTk/Luamm.cc
+++ b/src/FbTk/Luamm.cc
@@ -108,10 +108,6 @@ namespace lua {
108 /* 108 /*
109 * This function is called when lua encounters an error outside of any protected 109 * This function is called when lua encounters an error outside of any protected
110 * environment 110 * environment
111 * Throwing the exception through lua code appears to work, even if it was compiled
112 * without -fexceptions. If it turns out, it fails in some conditions, it could be
113 * replaced with some longjmp() magic. But that shouldn't be necessary, as this function
114 * will not be called under normal conditions (we execute everything in protected mode).
115 */ 111 */
116 int panic_throw(lua_State *l) 112 int panic_throw(lua_State *l)
117 { 113 {
@@ -191,6 +187,17 @@ namespace lua {
191 L->pop(1); 187 L->pop(1);
192 } 188 }
193 189
190 exception::exception(const exception &other)
191 : std::runtime_error(other), L(other.L)
192 {
193 L->checkstack(2);
194
195 L->rawgetfield(REGISTRYINDEX, lua_exception_namespace);
196 L->rawgeti(-1, other.key);
197 key = L->ref(-2);
198 L->pop(1);
199 }
200
194 exception::~exception() throw() 201 exception::~exception() throw()
195 { 202 {
196 if(not L) 203 if(not L)