[svn:parrot] r37174 - trunk/src/pmc

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sat Mar 7 18:34:11 UTC 2009


Author: fperrad
Date: Sat Mar  7 18:34:09 2009
New Revision: 37174
URL: https://trac.parrot.org/parrot/changeset/37174

Log:
[pmc] revert r37095.
What fixes it ? No new test.
But r37095 breaks ~80 tests on Lua.
See http://smolder.plusthree.com/app/public_projects/report_details/18464 (r37071) and http://smolder.plusthree.com/app/public_projects/report_details/18555 (r37106).
Segfault seems due to GC early freeing.

Modified:
   trunk/src/pmc/string.pmc

Modified: trunk/src/pmc/string.pmc
==============================================================================
--- trunk/src/pmc/string.pmc	Sat Mar  7 16:57:51 2009	(r37173)
+++ trunk/src/pmc/string.pmc	Sat Mar  7 18:34:09 2009	(r37174)
@@ -249,8 +249,10 @@
 
     VTABLE void set_string_native(STRING *value) {
         /* Only allow constant PMCs to embed constant strings */
-        if (PObj_constant_TEST(SELF) && !PObj_constant_TEST(value))
-             value = Parrot_str_copy(INTERP, value);
+        if (PObj_constant_TEST(SELF) && !PObj_constant_TEST(value)) {
+             const char *copy = Parrot_str_to_cstring(INTERP, value);
+             value            = Parrot_str_new_constant(INTERP, copy);
+        }
 
         SET_ATTR_str_val(INTERP, SELF, value);
     }


More information about the parrot-commits mailing list