[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/ActionExec.cpp server/Ac...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/ActionExec.cpp server/Ac... |
Date: |
Thu, 19 Oct 2006 11:16:27 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/10/19 11:16:27
Modified files:
. : ChangeLog
server : ActionExec.cpp ActionExec.h
Log message:
* server/ActioExec.{cpp,h}: added getWithStackLimit() method,
fixed pushWithStackEntry() to use the limit (documented why
in comments); fixed initialization list ordering.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1312&r2=1.1313
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ActionExec.cpp?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ActionExec.h?cvsroot=gnash&r1=1.5&r2=1.6
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1312
retrieving revision 1.1313
diff -u -b -r1.1312 -r1.1313
--- ChangeLog 19 Oct 2006 10:29:50 -0000 1.1312
+++ ChangeLog 19 Oct 2006 11:16:26 -0000 1.1313
@@ -1,5 +1,11 @@
2006-10-19 Sandro Santilli <address@hidden>
+ * server/ActioExec.{cpp,h}: added getWithStackLimit() method,
+ fixed pushWithStackEntry() to use the limit (documented why
+ in comments); fixed initialization list ordering.
+
+2006-10-19 Sandro Santilli <address@hidden>
+
* server/swf/ASHandlers.cpp: fix ActionExec use after privatization
of some members.
* server/ActionExec.{cpp,h}: more doxygen comments, with_stack
Index: server/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/ActionExec.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- server/ActionExec.cpp 19 Oct 2006 10:29:50 -0000 1.33
+++ server/ActionExec.cpp 19 Oct 2006 11:16:27 -0000 1.34
@@ -34,7 +34,7 @@
// forward this exception.
//
-/* $Id: ActionExec.cpp,v 1.33 2006/10/19 10:29:50 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.34 2006/10/19 11:16:27 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -91,30 +91,38 @@
const std::vector<with_stack_entry>& initial_with_stack,
bool nIsFunction2)
:
+ with_stack(initial_with_stack),
+ _with_stack_limit(7),
+ _function2_var(nIsFunction2),
code(abuf),
pc(nStartPC),
stop_pc(nStartPC+exec_bytes),
next_pc(nStartPC),
env(newEnv),
- retval(retval),
- with_stack(initial_with_stack),
- _function2_var(nIsFunction2)
+ retval(retval)
{
GNASH_REPORT_FUNCTION;
+
+ /// See: http://sswf.sourceforge.net/SWFalexref.html#action_with
+ if ( env.get_version() > 5 ) _with_stack_limit = 15;
}
ActionExec::ActionExec(const action_buffer& abuf, as_environment& newEnv)
:
+ with_stack(),
+ _with_stack_limit(7),
+ _function2_var(false),
code(abuf),
pc(0),
stop_pc(code.size()),
next_pc(0),
env(newEnv),
- retval(0),
- with_stack(),
- _function2_var(false)
+ retval(0)
{
GNASH_REPORT_FUNCTION;
+
+ /// See: http://sswf.sourceforge.net/SWFalexref.html#action_with
+ if ( env.get_version() > 5 ) _with_stack_limit = 15;
}
void
@@ -149,10 +157,12 @@
{
// Cleanup any expired "with" blocks.
- while ( with_stack.size() > 0
- && pc >= with_stack.back().end_pc() ) {
- // Drop this stack element
- with_stack.resize(with_stack.size() - 1);
+ while ( ! with_stack.empty() && pc >= with_stack.back().end_pc() )
+ {
+ // Drop last stack element
+ //with_stack.resize(with_stack.size() - 1);
+ with_stack.pop_back();
+ log_msg("reached end of last with stack entry, popping");
}
// Get the opcode.
@@ -247,7 +257,7 @@
bool
ActionExec::pushWithEntry(const with_stack_entry& entry)
{
- if (with_stack.size() < 8)
+ if (with_stack.size() < _with_stack_limit)
{
with_stack.push_back(entry);
return true;
Index: server/ActionExec.h
===================================================================
RCS file: /sources/gnash/gnash/server/ActionExec.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/ActionExec.h 19 Oct 2006 10:29:50 -0000 1.5
+++ server/ActionExec.h 19 Oct 2006 11:16:27 -0000 1.6
@@ -60,6 +60,12 @@
/// the 'with' stack associated with this execution thread
std::vector<with_stack_entry> with_stack;
+ /// Limit of with stack
+ //
+ /// This is 7 for SWF up to 5 and 15 for SWF 6 and up
+ /// See: http://sswf.sourceforge.net/SWFalexref.html#action_with
+ size_t _with_stack_limit;
+
bool _function2_var;
public:
@@ -136,6 +142,16 @@
return with_stack;
}
+ /// Return the maximum allowed 'with' stack limit.
+ //
+ /// See http://sswf.sourceforge.net/SWFalexref.html#action_with
+ /// for more info.
+ ///
+ size_t getWithStackLimit() const
+ {
+ return _with_stack_limit;
+ }
+
/// Push an entry to the with stack
//
/// @return
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/ActionExec.cpp server/Ac...,
Sandro Santilli <=