On Monday 17 December 2007 12:52:05 James Keenan via RT wrote:
> No, at least not on Ubuntu. (Will have to check later on other OSes.)
Okay, so memcpy doesn't fix it. That's good to know. How about explicitly
putting the destination PMC in a named variable so there's less pointer
shuffling and macro madness?
If this doesn't work, I want to know the version of gcc you're using so I can
make a giant space-based magnet to erase it completely from the universe.
-- c
=== src/ops/set.ops
==================================================================
--- src/ops/set.ops (revision 24021)
+++ src/ops/set.ops (local)
@@ -543,18 +543,19 @@
=cut
inline op copy(inout PMC, invar PMC) :base_mem {
+ PMC * dest = $1;
PMC * const clone = VTABLE_clone(interp, $2);
const INTVAL type = VTABLE_type(interp, $2);
/* avoid leaks and unreachable memory by destroying the destination PMC */
- if (PObj_active_destroy_TEST($1))
- VTABLE_destroy(interp, $1);
+ if (PObj_active_destroy_TEST(dest))
+ VTABLE_destroy(interp, dest);
- VTABLE_morph(interp, $1, type);
+ VTABLE_morph(interp, dest, type);
/* the source PMC knows how to clone itself, but we must reuse the
destination header */
- STRUCT_COPY($1, clone);
+ STRUCT_COPY(dest, clone);
/* don't let the clone's destruction destroy the destination's data */
PObj_active_destroy_CLEAR(clone);