[Swfdec-commits] Branch '0.6' - 3 commits - swfdec/swfdec_as_context.c swfdec/swfdec_text_field_movie.c test/trace

Benjamin Otte company at kemper.freedesktop.org
Fri Apr 4 10:03:32 PDT 2008


 swfdec/swfdec_as_context.c                                |    3 +++
 swfdec/swfdec_text_field_movie.c                          |    4 +++-
 test/trace/Makefile.am                                    |    9 +++++++++
 test/trace/crash-0.6.2-try-and-exception-on-dispose-5.swf |binary
 test/trace/crash-0.6.2-try-and-exception-on-dispose-6.swf |binary
 test/trace/crash-0.6.2-try-and-exception-on-dispose-7.swf |binary
 test/trace/crash-0.6.2-try-and-exception-on-dispose-8.swf |binary
 test/trace/crash-0.6.2-try-and-exception-on-dispose.as    |   14 ++++++++++++++
 8 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 88a0271611513c39e6a789630e0d264267b6e027
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Apr 4 18:04:59 2008 +0200

    compute right offset for inserting text in replaceText

diff --git a/swfdec/swfdec_text_field_movie.c b/swfdec/swfdec_text_field_movie.c
index 87f01a7..36e5e4b 100644
--- a/swfdec/swfdec_text_field_movie.c
+++ b/swfdec/swfdec_text_field_movie.c
@@ -1538,8 +1538,10 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text,
       continue;
     }
     /* adapt indexes: remove deleted part, add to-be inserted text */
-    if (findex->index_ > start_index) {
+    if (findex->index_ > end_index) {
       findex->index_ = findex->index_ + start_index - end_index + len;
+    } else if (findex->index_ >= start_index) {
+      findex->index_ = findex->index_ + start_index - end_index;
     }
   }
 
commit 0ffaee2c88d9d6c52c8f087b2abca0c35e48da26
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Apr 4 10:58:47 2008 +0200

    add test for just-fixed crasher

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 86add78..3bffb1c 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -727,6 +727,15 @@ EXTRA_DIST = \
 	crash-0.6.2-replaceText-8.swf \
 	crash-0.6.2-replaceText-8.swf.trace \
 	crash-0.6.2-replaceText.as \
+	crash-0.6.2-try-and-exception-on-dispose-5.swf \
+	crash-0.6.2-try-and-exception-on-dispose-5.swf.trace \
+	crash-0.6.2-try-and-exception-on-dispose-6.swf \
+	crash-0.6.2-try-and-exception-on-dispose-6.swf.trace \
+	crash-0.6.2-try-and-exception-on-dispose-7.swf \
+	crash-0.6.2-try-and-exception-on-dispose-7.swf.trace \
+	crash-0.6.2-try-and-exception-on-dispose-8.swf \
+	crash-0.6.2-try-and-exception-on-dispose-8.swf.trace \
+	crash-0.6.2-try-and-exception-on-dispose.as \
 	currentframe.swf \
 	currentframe.swf.trace \
 	dangling-compare.as \
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-5.swf b/test/trace/crash-0.6.2-try-and-exception-on-dispose-5.swf
new file mode 100644
index 0000000..e98c9fe
Binary files /dev/null and b/test/trace/crash-0.6.2-try-and-exception-on-dispose-5.swf differ
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-5.swf.trace b/test/trace/crash-0.6.2-try-and-exception-on-dispose-5.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-6.swf b/test/trace/crash-0.6.2-try-and-exception-on-dispose-6.swf
new file mode 100644
index 0000000..ba6bd21
Binary files /dev/null and b/test/trace/crash-0.6.2-try-and-exception-on-dispose-6.swf differ
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-6.swf.trace b/test/trace/crash-0.6.2-try-and-exception-on-dispose-6.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-7.swf b/test/trace/crash-0.6.2-try-and-exception-on-dispose-7.swf
new file mode 100644
index 0000000..788a1f5
Binary files /dev/null and b/test/trace/crash-0.6.2-try-and-exception-on-dispose-7.swf differ
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-7.swf.trace b/test/trace/crash-0.6.2-try-and-exception-on-dispose-7.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-8.swf b/test/trace/crash-0.6.2-try-and-exception-on-dispose-8.swf
new file mode 100644
index 0000000..8695f70
Binary files /dev/null and b/test/trace/crash-0.6.2-try-and-exception-on-dispose-8.swf differ
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose-8.swf.trace b/test/trace/crash-0.6.2-try-and-exception-on-dispose-8.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.6.2-try-and-exception-on-dispose.as b/test/trace/crash-0.6.2-try-and-exception-on-dispose.as
new file mode 100644
index 0000000..42f4083
--- /dev/null
+++ b/test/trace/crash-0.6.2-try-and-exception-on-dispose.as
@@ -0,0 +1,14 @@
+// makeswf -v 7 -s 200x150 -r 1 -o crash-0.6.2-try-and-exception-on-dispose.swf crash-0.6.2-try-and-exception-on-dispose.as
+
+getURL ("fscommand:quit", "");
+
+function boom () {
+  try {
+    return;
+    trace ("hi");
+  } catch (e) {
+  };
+};
+
+boom ();
+throw ("hi");
commit 2cacb713e04a39253b87d2512247e402a5f49bc8
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Apr 4 10:56:16 2008 +0200

    fix SEGV when collecting frames that are in a try block
    
    ... while the context is in an exception state

diff --git a/swfdec/swfdec_as_context.c b/swfdec/swfdec_as_context.c
index c75f15a..f2b4d09 100644
--- a/swfdec/swfdec_as_context.c
+++ b/swfdec/swfdec_as_context.c
@@ -519,6 +519,9 @@ swfdec_as_context_dispose (GObject *object)
 
   while (context->stack)
     swfdec_as_stack_pop_segment (context);
+  /* We need to make sure there's no exception here. Otherwise collecting 
+   * frames that are inside a try block will assert */
+  swfdec_as_context_catch (context, NULL);
   swfdec_as_context_collect (context);
   if (context->memory != 0) {
     g_critical ("%zu bytes of memory left over\n", context->memory);


More information about the Swfdec-commits mailing list