gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/PropertyList.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/PropertyList.cpp
Date: Tue, 06 May 2008 14:55:25 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/06 14:55:25

Modified files:
        .              : ChangeLog 
        server         : PropertyList.cpp 

Log message:
                * server/PropertyList.cpp (setValue): don't let prop flags
                  prevent setting values of destructive properties.
                  set_member doesn't use this function, so user-requested
                  override is still handled correctly. init_member instead
                  which is only used by internal code, will use it.
                  NOTE: in a cleaner design, we'd use native destructive
                  getter returning an as_value directly instead !
                  Fixes abort reported on bug #23139.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6527&r2=1.6528
http://cvs.savannah.gnu.org/viewcvs/gnash/server/PropertyList.cpp?cvsroot=gnash&r1=1.36&r2=1.37

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6527
retrieving revision 1.6528
diff -u -b -r1.6527 -r1.6528
--- ChangeLog   6 May 2008 13:33:39 -0000       1.6527
+++ ChangeLog   6 May 2008 14:55:24 -0000       1.6528
@@ -1,3 +1,14 @@
+2008-05-06 Sandro Santilli <address@hidden>
+
+       * server/PropertyList.cpp (setValue): don't let prop flags
+         prevent setting values of destructive properties.
+         set_member doesn't use this function, so user-requested
+         override is still handled correctly. init_member instead
+         which is only used by internal code, will use it.
+         NOTE: in a cleaner design, we'd use native destructive
+         getter returning an as_value directly instead !
+         Fixes abort reported on bug #23139.
+
 2008-05-06 Benjamin Wolsey <address@hidden>
 
        * libmedia/ffmpeg/sound_handler_sdl.{h,cpp}: drop unnecessary

Index: server/PropertyList.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/PropertyList.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/PropertyList.cpp     6 May 2008 09:54:28 -0000       1.36
+++ server/PropertyList.cpp     6 May 2008 14:55:25 -0000       1.37
@@ -181,15 +181,21 @@
 #endif
                return true;
        }
-       if (found->isReadOnly())
+
+       const Property& prop = *found;
+       if (prop.isReadOnly() && ! prop.isDestructive())
        {
                string_table& st = VM::get().getStringTable();
                log_error(_("Property %s (key %d) in namespace %s (key %d) is 
read-only %s, not setting it to %s"), 
-                       st.value(key), key, st.value(nsId), nsId, 
found->getFlags(), val);
+                       st.value(key), key, st.value(nsId), nsId, 
prop.getFlags(), val);
                return false;
        }
 
-       const_cast<Property*>(&(*found))->setValue(this_ptr, val);
+       // Property is const because the container uses its members
+       // for indexing. We don't use value (only name and namespace)
+       // so this const_cast is safe
+       const_cast<Property&>(prop).setValue(this_ptr, val);
+
        return true;
 }
 




reply via email to

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