[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/swf_function.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/swf_function.cpp |
Date: |
Tue, 09 Oct 2007 20:19:15 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/09 20:19:15
Modified files:
. : ChangeLog
server : swf_function.cpp
Log message:
* server/swf_function.cpp (call operator): pop call stack frame
on
exception. Fixes assertion failure on restart reported by bwy
in
in bug #21295
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4580&r2=1.4581
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.cpp?cvsroot=gnash&r1=1.36&r2=1.37
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4580
retrieving revision 1.4581
diff -u -b -r1.4580 -r1.4581
--- ChangeLog 9 Oct 2007 16:34:53 -0000 1.4580
+++ ChangeLog 9 Oct 2007 20:19:14 -0000 1.4581
@@ -1,5 +1,8 @@
2007-10-10 Sandro Santilli <address@hidden>
+ * server/swf_function.cpp (call operator): pop call stack frame on
+ exception. Fixes assertion failure on restart reported by bwy in
+ in bug #21295
* server/as_environment.h: don't use size() or length()
when empty() is really meant (in some cases empty() is much
faster).
Index: server/swf_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/swf_function.cpp 23 Sep 2007 08:48:18 -0000 1.36
+++ server/swf_function.cpp 9 Oct 2007 20:19:15 -0000 1.37
@@ -172,6 +172,7 @@
{
our_env = &fn.env();
}
+ //our_env = &fn.env(); // I think this should be it...
assert(our_env);
#if 0
@@ -179,12 +180,12 @@
log_msg(" first_arg_bottom_index: %d\n", fn.first_arg_bottom_index);
#endif
- // Set up local stack frame, for parameters and locals.
- our_env->pushCallFrame(this);
-
// Some features are version-dependant
unsigned swfversion = VM::get().getSWFVersion();
+ // Set up local stack frame, for parameters and locals.
+ our_env->pushCallFrame(this);
+
if (m_is_function2 == false)
{
// Conventional function.
@@ -322,11 +323,36 @@
}
}
+
+ as_value result;
+
// Execute the actions.
+ // Do this in a try block to proper drop the pushed call frame
+ // in case of problems (most interesting action limits)
+ try
+ {
//ActionExec exec(*m_action_buffer, *our_env, m_start_pc, m_length,
fn.result, m_with_stack, m_is_function2);
- as_value result;
ActionExec exec(*this, *our_env, &result, fn.this_ptr.get());
exec();
+ }
+ catch (ActionLimitException& ale) // expected and sane
+ {
+ //log_debug("ActionLimitException got from swf_function
execution: %s", ale.what());
+ our_env->popCallFrame();
+ throw;
+ }
+ catch (std::exception& ex) // unexpected but we can tell what it is
+ {
+ log_debug("Unexpected exception from swf_function execution:
%s", ex.what());
+ our_env->popCallFrame();
+ throw;
+ }
+ catch (...) // unexpected, unknown, but why not cleaning up...
+ {
+ log_debug("Unknown exception got from swf_function execution");
+ our_env->popCallFrame();
+ throw;
+ }
our_env->popCallFrame();
return result;