Skip to content
Browse files

small rearrangement for correctness

  • Loading branch information...
1 parent fe2bbd9 commit bc49cf6e83fad855d9ca717ee20a148881659df9 @plobsing committed Aug 7, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/deepclone.winxed
View
9 src/deepclone.winxed
@@ -80,17 +80,18 @@ class DeepClone {
for (int i = 0; i < self.todo; i++) {
var orig = self.todo[i];
- var meta = nci['pmc_get_meta'](orig);
self.state = VISIT_FREEZE_NORMAL;
nci['Parrot_PMC_visit'](orig, self);
nci['Parrot_PMC_freeze'](orig, self);
- self.push_pmc(meta);
int addr = nci['pmc_addr'](orig);
var dup = self.seen[addr];
self.state = VISIT_THAW_NORMAL;
- nci['Parrot_PMC_visit'](dup, self);
nci['Parrot_PMC_thaw'](dup, self);
+ nci['Parrot_PMC_visit'](dup, self);
+
+ var meta = nci['pmc_get_meta'](orig);
+ self.push_pmc(meta);
nci['pmc_set_meta'](dup, self.shift_pmc());
}
@@ -109,7 +110,6 @@ class DeepClone {
function push_pmc[vtable] (var v) {
using static nci;
- int addr = nci['pmc_addr'](v);
var dup;
int nullp;
@@ -118,6 +118,7 @@ class DeepClone {
dup = null;
}
else {
+ int addr = nci['pmc_addr'](v);
dup = self.seen[addr];
${ isnull nullp, dup };
if (nullp) {

0 comments on commit bc49cf6

Please sign in to comment.
Something went wrong with that request. Please try again.