gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/vm/ActionExec.cpp testsu...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/vm/ActionExec.cpp testsu...
Date: Wed, 18 Jun 2008 07:15:43 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/06/18 07:15:43

Modified files:
        .              : ChangeLog 
        server/vm      : ActionExec.cpp 
        testsuite/swfdec: PASSING 

Log message:
                * server/vm/ActionExec.cpp: fix try/catch in functions without 
using
                  a special case. Also passes the ordinary try tests in swfdec 
(needed
                  Error too).
                * server/swfdec/PASSING: three passes in try.
        
                Still one unexpected failure for a malformed (I think) try 
case, but
                it's getting there slowly. 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6967&r2=1.6968
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.83&r2=1.84
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.147&r2=1.148

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6967
retrieving revision 1.6968
diff -u -b -r1.6967 -r1.6968
--- ChangeLog   18 Jun 2008 00:33:09 -0000      1.6967
+++ ChangeLog   18 Jun 2008 07:15:42 -0000      1.6968
@@ -1,3 +1,10 @@
+2008-06-18 Benjamin Wolsey <address@hidden>
+
+       * server/vm/ActionExec.cpp: fix try/catch in functions without using
+         a special case. Also passes the ordinary try tests in swfdec (needed
+         Error too).
+       * server/swfdec/PASSING: three passes in try.
+
 2008-06-17 Markus Gothe <address@hidden>
 
        * configure.ac, libbase/utility.h, libamf/element.cpp:

Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- server/vm/ActionExec.cpp    17 Jun 2008 19:36:44 -0000      1.83
+++ server/vm/ActionExec.cpp    18 Jun 2008 07:15:42 -0000      1.84
@@ -52,7 +52,7 @@
 # define STACK_DUMP_LIMIT 32
 
 // Define to get debugging messages for try / catch
-//#define GNASH_DEBUG_TRY 1
+#define GNASH_DEBUG_TRY 1
 
 #endif
 
@@ -380,15 +380,21 @@
 // finally { };
 //
 // The catch and finally blocks are both optional.
-// 1. the catch block is *always* executed, even when no exception is thrown.
+// 1. the catch block is *always* executed, even when no exception is thrown. 
This
+//    may be different when the catch variable is typed ( "catch (e:Error) 
{};" )
 // 2. the finally block is *always* executed, even when an exception is thrown.
 // 3. execution is interrupted if there are no catchers left and an exception
 //    is still on the stack.
-//
+// 4. If an exception is thrown in a function and not caught within that 
function,
+//    the return value is the exception, unless the 'finally' block has its own
+//    return. (In that case, the exception is never handled).
 bool
 ActionExec::processExceptions(TryBlock& t)
 {
 
+    if (retval) log_debug("Retval exists");
+    if (t._hasName) log_debug("Has name");
+
     switch (t._tryState)
     {
 
@@ -503,6 +509,13 @@
                           "again (%s). Replaces any previous "
                           "uncaught exceptions", ex);
 #endif
+
+                // Return any exceptions thrown in catch. This
+                // can be overridden by a return in finally. 
+                // Should these be thrown to the register too
+                // if it is a catch-in-register case?
+                if (retval) *retval = t._lastThrow;
+
             }
             stop_pc = t._afterTriedOffset;
             t._tryState = TryBlock::TRY_END;
@@ -535,19 +548,12 @@
                 as_value ex = t._lastThrow;
                 ex.unflag_exception();
                 log_debug("END: no new exceptions thrown. Pushing "
-                          "uncaught one (%s) back", ex);
+                      "uncaught one (%s) back on stack", ex);
 #endif
+
                 env.push(t._lastThrow);
-                if ((t._finallyOffset == t._savedEndOffset) && retval)
-                {
-                    // This was taken over from the previous
-                    // implementation. It happens when there is
-                    // no 'finally' block. It seems to be a bit of
-                    // a hack now, though it may be correct. It
-                    // passes misc-mtasc.all/exceptions.swf.
-                    // TODO: more tests needed.                            
-                    *retval = t._lastThrow;
-                }
+ 
+
                 _tryList.pop_back();
                 return true;
             }
@@ -561,7 +567,7 @@
             // Finished with this TryBlock.
             _tryList.pop_back();
             
-            // Will break of of action execution.
+            // Will break out of action execution.
             if (_returning) return false;
                    
             break;

Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -b -r1.147 -r1.148
--- testsuite/swfdec/PASSING    11 Jun 2008 20:54:44 -0000      1.147
+++ testsuite/swfdec/PASSING    18 Jun 2008 07:15:43 -0000      1.148
@@ -996,6 +996,9 @@
 transform-properties-5.swf:9332e41f53db6ec456387efffd9e12a7
 transform-properties-5.swf:b0386824584340e1d0a80f986ce779b9
 transform.swf:5c8533f9168ca3e92d000ce1693ed5ef
+try-6.swf:f9672870259f993617e5e41cf2e0bb95
+try-7.swf:8424e6654fbec5473daa8563d5b4b5a8
+try-8.swf:57b437db826c99258098cfbdd5db8b1f
 try-finally-5.swf:419caca90cf6f0dcd1b202836c5bd8a0
 try-finally-6.swf:8b462341ecc190d6468a6eb143c0cb33
 try-finally-7.swf:28fc37a5dcb77e53519b45128fa8ac3c




reply via email to

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