gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/array.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/array.h
Date: Wed, 06 Feb 2008 15:22:21 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/02/06 15:22:21

Modified files:
        .              : ChangeLog 
        server         : array.h 

Log message:
        sort a copy of elements when using a custom function, to avoid the 
custom
        function invocations to mess with the container being scanned. Fixes a
        memory corruption that was triggered by just-added tests in array.as,
        but still doesn't fix bug #22239 (must be another such case).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5576&r2=1.5577
http://cvs.savannah.gnu.org/viewcvs/gnash/server/array.h?cvsroot=gnash&r1=1.40&r2=1.41

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5576
retrieving revision 1.5577
diff -u -b -r1.5576 -r1.5577
--- ChangeLog   6 Feb 2008 15:20:56 -0000       1.5576
+++ ChangeLog   6 Feb 2008 15:22:20 -0000       1.5577
@@ -1,3 +1,11 @@
+2008-02-06 Sandro Santilli <address@hidden>
+
+       * server/array.h (sort): sort a copy of elements when using a custom
+         function, to avoid the custom function invocations to mess with
+         the container being scanned. Fixes a memory corruption that was
+         triggered by just-added tests in array.as, but still doesn't fix
+         bug #22239 (must be another such case).
+
 2008-02-06 Benjamin Wolsey <address@hidden>
 
        * libbase/utf8.{cpp,h}: take SWF version argument, use ISO-8859

Index: server/array.h
===================================================================
RCS file: /sources/gnash/gnash/server/array.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- server/array.h      21 Jan 2008 20:55:48 -0000      1.40
+++ server/array.h      6 Feb 2008 15:22:21 -0000       1.41
@@ -218,7 +218,11 @@
        template <class AVCMP>
        void sort(AVCMP avc)
        {
-               std::sort(elements.begin(), elements.end(), avc);
+               std::deque<as_value> nelem = std::deque<as_value>(elements);
+
+               std::sort(nelem.begin(), nelem.end(), avc);
+
+               elements = nelem;
        }
 
        /// \brief




reply via email to

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