Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hopefully fix nasty GC bug with COWed strings
git-svn-id: https://svn.parrot.org/parrot/trunk@12062 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Leopold Toetsch committed Mar 28, 2006
1 parent 41519cc commit fbc4ad5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/string.c
Expand Up @@ -135,6 +135,11 @@ Parrot_make_COW_reference(Interp *interpreter, STRING *s)
d = new_string_header(interpreter, 0);
PObj_COW_SET(s);
copy_string_header(interpreter, d, s);
/* we can't move the memory, because constants aren't
* scanned in compact_pool, therefore the other end
* would point to garbage.
*/
PObj_external_SET(d);
}
else {
d = new_string_header(interpreter, PObj_get_FLAGS(s));
Expand Down Expand Up @@ -167,6 +172,7 @@ Parrot_reuse_COW_reference(Interp *interpreter, STRING *s, STRING *d)
PObj_COW_SET(s);
copy_string_header(interpreter, d, s);
PObj_constant_CLEAR(d);
PObj_external_SET(d);
}
else {
PObj_COW_SET(s);
Expand Down

0 comments on commit fbc4ad5

Please sign in to comment.