gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-444-gafd471f
Date: Wed, 30 Mar 2011 19:55:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  afd471f52cdc056b8c4009979c3ccae4b0963338 (commit)
       via  07d3d7ed48808132ec860ff83b011ea9d7dad655 (commit)
      from  2ed5357f6da78948d47fec7b7fba0121c16f07ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=afd471f52cdc056b8c4009979c3ccae4b0963338


commit afd471f52cdc056b8c4009979c3ccae4b0963338
Author: Sandro Santilli <address@hidden>
Date:   Wed Mar 30 21:39:27 2011 +0200

    Make sure testsuite run is not affected by user-defined script limits

diff --git a/testsuite/gnashrc.in b/testsuite/gnashrc.in
index fda7e29..e8fde00 100644
--- a/testsuite/gnashrc.in
+++ b/testsuite/gnashrc.in
@@ -59,4 +59,10 @@ set LCShmkey 138765373
 # Do not ignore FSCommand while running tests !
 set ignoreFSCommand false
 
+# Make sure user script limit setting don't get
+# in our way while testing
+set scriptsTimeout 30
+set scriptsRecursionLimit 256
+set lockScriptLimits false
+
 # TODO: enable extensions ?

http://git.savannah.gnu.org/cgit//commit/?id=07d3d7ed48808132ec860ff83b011ea9d7dad655


commit 07d3d7ed48808132ec860ff83b011ea9d7dad655
Author: Sandro Santilli <address@hidden>
Date:   Wed Mar 30 21:31:02 2011 +0200

    _really_ continue on scriptTimeout if the user chooses not to disable 
scripts.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 7f26d6e..1deb132 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -233,9 +233,7 @@ movie_root::setRootMovie(Movie* movie)
         processActionQueue();
     }
     catch (const ActionLimitException& al) {
-        boost::format fmt = boost::format(_("ActionLimits hit during "
-                    "setRootMovie: %s. Disable scripts?")) % al.what();
-        handleActionLimitHit(fmt.str());
+        handleActionLimitHit(al.what());
     }
     catch (const ActionParserException& e) {
         log_error("ActionParserException thrown during setRootMovie: %s",
@@ -245,9 +243,11 @@ movie_root::setRootMovie(Movie* movie)
     cleanupAndCollect();
 }
 
-void
-movie_root::handleActionLimitHit(const std::string& msg)
+bool
+movie_root::abortOnScriptTimeout(const std::string& what) const
 {
+    std::string msg = what + std::string(". Disable scripts? ");
+
     bool disable = true;
     if (_interfaceHandler) {
         disable = callInterface<bool>(HostMessage(HostMessage::QUERY, msg));
@@ -256,10 +256,15 @@ movie_root::handleActionLimitHit(const std::string& msg)
         log_error("No user interface registered, assuming 'Yes' answer to "
             "question: %s", msg);
     }
-    if (disable) {
-        disableScripts();
-        clear(_actionQueue);
-    }
+    return disable;
+}
+
+void
+movie_root::handleActionLimitHit(const std::string& msg)
+{
+    log_debug("Disabling scripts: %1%", msg);
+    disableScripts();
+    clear(_actionQueue);
 }
 
 void
@@ -698,9 +703,7 @@ movie_root::fire_mouse_event()
         processActionQueue();
     }
     catch (const ActionLimitException& al) {
-        boost::format fmt = boost::format(_("ActionLimits hit during mouse "
-                    "event processing: %s. Disable scripts ?")) % al.what();
-        handleActionLimitHit(fmt.str());
+        handleActionLimitHit(al.what());
     }
 
     return need_redraw;
@@ -865,10 +868,7 @@ movie_root::advance()
         // The PP does not disable scripts when the stack limit is reached,
         // but rather struggles on. 
         // TODO: find a test case for this, if confirmed fix accordingly
-        boost::format fmt = boost::format(
-            _("ActionLimits hit during advance: %1%. Disable scripts ? "))
-            % al.what();
-        handleActionLimitHit(fmt.str());
+        handleActionLimitHit(al.what());
     }
     catch (const ActionParserException& e) {
         log_error(_("Buffer overread during advance: %s"), e.what());
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index ce42cc4..e95809e 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -823,6 +823,8 @@ public:
         return _gc;
     }
 
+    bool abortOnScriptTimeout(const std::string& when) const;
+
 private:
 
     /// Set the root movie, replacing the current one if any.
diff --git a/libcore/vm/ActionExec.cpp b/libcore/vm/ActionExec.cpp
index 726f0db..a653e60 100644
--- a/libcore/vm/ActionExec.cpp
+++ b/libcore/vm/ActionExec.cpp
@@ -299,7 +299,11 @@ ActionExec::operator()()
                             "executing code in %1% between pc %2% and %3%")) %
                             code.getMovieDefinition().get_url() % next_pc %
                             pc % (maxTime/1000);
-                    throw ActionLimitException(fmt.str());
+                    if ( getRoot(env).abortOnScriptTimeout(fmt.str()) ) {
+                        throw ActionLimitException(fmt.str());
+                    } else {
+                        clock.restart();
+                    }
                 }
                 // TODO: Run garbage collector ? If stack isn't too big ?
             }

-----------------------------------------------------------------------

Summary of changes:
 libcore/movie_root.cpp    |   32 ++++++++++++++++----------------
 libcore/movie_root.h      |    2 ++
 libcore/vm/ActionExec.cpp |    6 +++++-
 testsuite/gnashrc.in      |    6 ++++++
 4 files changed, 29 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]