[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/as...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/as... |
Date: |
Thu, 05 Jun 2008 10:08:34 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/06/05 10:08:33
Modified files:
. : ChangeLog
server : movie_root.cpp as_environment.cpp
Log message:
* server/as_environment.cpp: fix warning, minor changes.
* server/movie_root.cpp: don't disable scripts when we hit
the recursion limit. A recursion limit can be 0 or 1, so
mouse and key notifiers need to catch the ActionLimits
exception.
It may be better not to call them. This makes Gnash behaviour
more
or less compatible, though in some cases we may be pushing
less on
the stack than we should, which of course changes behaviour.
Real-life cases sometimes show different behaviour from what's
expected when the limit is very low. This may be for other
reasons than the stack limit. Probably it's more important that
Gnash have a sensible policy with recursion than compatibility
in
every regard (though this would be good too), as it's an
undocumented feature and tends to be used to extend the
recursion
limit when required, not for achieving fine-grained effects.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6826&r2=1.6827
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.201&r2=1.202
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.135&r2=1.136
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6826
retrieving revision 1.6827
diff -u -b -r1.6826 -r1.6827
--- ChangeLog 5 Jun 2008 09:40:33 -0000 1.6826
+++ ChangeLog 5 Jun 2008 10:08:32 -0000 1.6827
@@ -1,3 +1,13 @@
+2008-06-05 Benjamin Wolsey <address@hidden>
+
+ * server/as_environment.cpp: fix warning, minor changes.
+ * server/movie_root.cpp: don't disable scripts when we hit
+ the recursion limit. A recursion limit can be 0 or 1, so
+ mouse and key notifiers need to catch the ActionLimits exception.
+ It may be better not to call them. This makes Gnash behaviour more
+ or less compatible, though in some cases we may be pushing less on
+ the stack than we should, which of course changes behaviour.
+
2008-06-05 Sandro Santilli <address@hidden>
* libmedia/ffmpeg/: AudioDecoderFfmpeg.cpp, VideoDecoderFfmpeg.cpp:
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -b -r1.201 -r1.202
--- server/movie_root.cpp 4 Jun 2008 19:54:12 -0000 1.201
+++ server/movie_root.cpp 5 Jun 2008 10:08:33 -0000 1.202
@@ -194,9 +194,13 @@
}
catch (ActionLimitException& al)
{
- log_error(_("ActionLimits hit during setRootMovie: %s. "
- "Disabling scripts"), al.what());
- disableScripts();
+ //log_error(_("ActionLimits hit during setRootMovie: %s. "
+ // "Disabling scripts"), al.what());
+ //disableScripts();
+
+ // The PP doesn't disable scripts here, but rather abandons processing
+ // carries on.
+ log_error(_("ActionLimits hit during setRootMovie: %s."),
al.what());
clearActionQueue();
}
@@ -596,14 +600,28 @@
// for user defined handerlers.
if(global_key)
{
+ try
+ {
+ // Can throw an action limit exception if the stack limit is 0
or 1,
+ // i.e. if the stack is at the limit before it contains
anything.
+ // A stack limit like that is hardly of any use, but could be used
+ // maliciously to crash Gnash.
if(down)
{
global_key->notify_listeners(event_id::KEY_DOWN);
global_key->notify_listeners(event_id::KEY_PRESS);
}
else
+ {
global_key->notify_listeners(event_id::KEY_UP);
}
+ }
+ catch (ActionLimitException &e)
+ {
+ log_error(_("ActionLimits hit notifying key listeners: %s."),
e.what());
+ clearActionQueue();
+ }
+ }
processActionQueue();
@@ -1065,8 +1083,12 @@
}
catch (ActionLimitException& al)
{
- log_error(_("ActionLimits hit during advance: %s. Disabling
scripts"), al.what());
- disableScripts();
+ //log_error(_("ActionLimits hit during advance: %s. Disabling
scripts"), al.what());
+ //disableScripts();
+
+ // The PP does not disable scripts when the stack limit is reached,
+ // but rather struggles on.
+ log_error(_("Action limit hit during advance: %s."), al.what());
clearActionQueue();
}
@@ -1260,8 +1282,21 @@
ObjPtr mouseObj = getMouseObject();
if ( mouseObj )
{
+
+ try
+ {
+ // Can throw an action limit exception if the stack limit is 0 or
1.
+ // A stack limit like that is hardly of any use, but could be used
+ // maliciously to crash Gnash.
mouseObj->callMethod(NSV::PROP_BROADCAST_MESSAGE,
as_value(PROPNAME(event.get_function_name())));
}
+ catch (ActionLimitException &e)
+ {
+ log_error(_("ActionLimits hit notifying mouse events: %s."),
e.what());
+ clearActionQueue();
+ }
+
+ }
assert(testInvariant());
@@ -2095,6 +2130,7 @@
_recursionLimit = recursion;
_timeoutLimit = timeout;
+
}
Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -b -r1.135 -r1.136
--- server/as_environment.cpp 4 Jun 2008 19:54:11 -0000 1.135
+++ server/as_environment.cpp 5 Jun 2008 10:08:33 -0000 1.136
@@ -882,12 +882,14 @@
// The stack size can be changed by the ScriptLimits
// tag. There is *no* difference between SWF versions.
// TODO: override from gnashrc.
+
+ // A stack size of 0 is apparently legitimate.
const boost::uint16_t maxstacksize =
VM::get().getRoot().getRecursionLimit();
// Doesn't proceed if the stack size would reach the limit; should
// this check be done somewhere after adding to the stack? Would
// it make any difference?
- if ( _localFrames.size() == maxstacksize - 1 )
+ if ( _localFrames.size() + 1 >= maxstacksize )
{
std::ostringstream ss;
ss << boost::format(_("Max stack count reached (%u)")) %
_localFrames.size();
- [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/as...,
Benjamin Wolsey <=