[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/with...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/with... |
Date: |
Fri, 12 Jan 2007 10:59:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/01/12 10:59:48
Modified files:
. : ChangeLog
testsuite/actionscript.all: with.as
server/vm : ActionExec.cpp ActionExec.h
Log message:
* server/vm/ActionExec.{h,cpp}: don't really
limit the size of 'with' stack. Only use the
limit information to warn user when ActionScript errors
verbosity is enabled.
* testsuite/actionscript.all/with.as: don't assume 'with'
stack limits are driven by SWF# (it will depend on the player
version instead).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2096&r2=1.2097
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/with.as?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.h?cvsroot=gnash&r1=1.5&r2=1.6
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2096
retrieving revision 1.2097
diff -u -b -r1.2096 -r1.2097
--- ChangeLog 12 Jan 2007 10:27:33 -0000 1.2096
+++ ChangeLog 12 Jan 2007 10:59:48 -0000 1.2097
@@ -1,5 +1,12 @@
2007-01-12 Sandro Santilli <address@hidden>
+ * server/vm/ActionExec.{h,cpp}: don't really
+ limit the size of 'with' stack. Only use the
+ limit information to warn user when ActionScript errors
+ verbosity is enabled.
+ * testsuite/actionscript.all/with.as: don't assume 'with'
+ stack limits are driven by SWF# (it will depend on the player
+ version instead).
* testsuite/actionscript.all/Color.as:
Use typeof() for stricter checking, fix case of methods.
* server/asobj/Color.cpp: fix case of methods.
Index: testsuite/actionscript.all/with.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/with.as,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- testsuite/actionscript.all/with.as 5 Nov 2006 00:45:27 -0000 1.6
+++ testsuite/actionscript.all/with.as 12 Jan 2007 10:59:48 -0000 1.7
@@ -22,7 +22,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: with.as,v 1.6 2006/11/05 00:45:27 rsavoye Exp $";
+rcsid="$Id: with.as,v 1.7 2007/01/12 10:59:48 strk Exp $";
#include "check.as"
@@ -80,19 +80,21 @@
}}}}}}} // depth 7 (should be supported by SWF5)
check_equals(found7, 1); // this works if the above worked
-// Try with a depth of 8, should be unsupported by SWF5
+#if OUTPUT_VERSION > 5
+// Try with a depth of 8, should be supported by Players from version 6 up
// but supported by later target (alexis sais)
with(o8) {
with(o) { with(o) { with(o) { with(o) { with(o) { with(o) { with(o) {
check_equals(obj.a, 1); // scan back to the root
found8 = a;
}}}}}}}} // depth 8 (should be unsupported by SWF5)
-#if OUTPUT_VERSION > 5
check_equals(found8, 1);
#else
-check_equals(found8, undefined);
+// Don't assume that SWF version drives this: it only depends on the player.
+//check_equals(found8, undefined);
#endif
+#if 0 // Don't assume that SWF version drives this: it only depends on the
player!
// Try with a depth of 17, should be unsupported with all targets
// target
with(o17) {
@@ -101,3 +103,4 @@
found17 = a; // this should never execute !
}}}}}}}}}}}}}}}}}
check_equals(found17, undefined);
+#endif
Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/vm/ActionExec.cpp 6 Jan 2007 00:23:31 -0000 1.9
+++ server/vm/ActionExec.cpp 12 Jan 2007 10:59:48 -0000 1.10
@@ -16,7 +16,7 @@
//
-/* $Id: ActionExec.cpp,v 1.9 2007/01/06 00:23:31 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.10 2007/01/12 10:59:48 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -72,6 +72,7 @@
ActionExec::ActionExec(const swf_function& func, as_environment& newEnv,
as_value* nRetVal)
:
with_stack(func.getWithStack()),
+ // See comment in header
_with_stack_limit(7),
_function_var(func.isFunction2() ? 2 : 1),
_func(&func),
@@ -84,7 +85,7 @@
{
//GNASH_REPORT_FUNCTION;
- /// See: http://sswf.sourceforge.net/SWFalexref.html#action_with
+ // See comment in header
if ( env.get_version() > 5 ) _with_stack_limit = 15;
}
@@ -103,7 +104,7 @@
{
//GNASH_REPORT_FUNCTION;
- /// See: http://sswf.sourceforge.net/SWFalexref.html#action_with
+ /// See comment in header
if ( env.get_version() > 5 ) _with_stack_limit = 15;
}
@@ -261,15 +262,21 @@
bool
ActionExec::pushWithEntry(const with_stack_entry& entry)
{
- if (with_stack.size() < _with_stack_limit)
- {
+ // See comment in header about _with_stack_limit
+ IF_VERBOSE_ASCODING_ERRORS (
+ if (with_stack.size() >= _with_stack_limit)
+ {
+ log_aserror("'With' stack depth (" SIZET_FMT ") "
+ "exceeds the allowed limit for current SWF "
+ "target version (" SIZET_FMT " for version %d)."
+ " Don't expect this movie to work with all players.",
+ with_stack.size()+1, _with_stack_limit,
+ env.get_version());
+ }
+ );
+
with_stack.push_back(entry);
return true;
- }
- else
- {
- return false;
- }
}
bool
Index: server/vm/ActionExec.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/vm/ActionExec.h 31 Dec 2006 14:02:36 -0000 1.5
+++ server/vm/ActionExec.h 12 Jan 2007 10:59:48 -0000 1.6
@@ -47,6 +47,16 @@
//
/// This is 7 for SWF up to 5 and 15 for SWF 6 and up
/// See: http://sswf.sourceforge.net/SWFalexref.html#action_with
+ ///
+ /// Actually, there's likely NO point in using the limit.
+ /// The spec say that a player6 is ensured to provide at least 15
elements
+ /// in a 'with' stack, while player5 can support at most 7.
+ /// There is no provision of a limit though.
+ ///
+ /// Gnash will use this information only to generate useful
+ /// warnings for coders (if ActionScript errors verbosity is
+ /// enabled).
+ ///
size_t _with_stack_limit;
/// 1 for function execution, 2 for function2 execution, 0 otherwise.
@@ -166,6 +176,11 @@
/// See http://sswf.sourceforge.net/SWFalexref.html#action_with
/// for more info.
///
+ /// Note that Gnash have NO limit on the number of 'with'
+ /// stack entries, this information will only be used to
+ /// generate useful warnings for coders (if ActionScript errors
+ /// verbosity is enabled).
+ ///
size_t getWithStackLimit() const
{
return _with_stack_limit;
@@ -174,8 +189,12 @@
/// Push an entry to the with stack
//
/// @return
- /// true if the entry was pushed,
- /// false otherwise (the stack is limited to 8 slots)
+ /// true if the entry was pushed, false otherwise.
+ /// Note that false will *never* be returned as Gnash
+ /// removed the 'with' stack limit. If the documented
+ /// limit for stack (SWF# bound) is reached, and ActionScript
+ /// errors verbosity is enabled, a warning will be raised,
+ /// but the call will still succeed.
///
bool pushWithEntry(const with_stack_entry& entry);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/with...,
Sandro Santilli <=