From 1bdb79d0ea3954ab5a2a027041f09bb42170c0d5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 3 Jul 2016 02:20:54 -0700 Subject: 3090 --- 073deep_copy.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/073deep_copy.cc b/073deep_copy.cc index ed53caf7..9daf951b 100644 --- a/073deep_copy.cc +++ b/073deep_copy.cc @@ -190,15 +190,14 @@ int deep_copy_address(const reagent& canonized_in, map& addresses_copi trace(9991, "run") << "recursing on payload " << payload.value << ' ' << to_string(payload) << end(); vector data = deep_copy(payload, tmp); trace(9991, "run") << "deep-copy: writing result " << out << ": " << to_string(data) << end(); - reagent/*copy*/ out_payload = payload; // not canonized // HACK: write_memory interface isn't ideal for this situation; we need // a temporary location to help copy the payload. trace(9991, "run") << "deep-copy: writing temporary " << tmp.value << ": " << out << end(); put(Memory, tmp.value, out); - out_payload.value = tmp.value; - vector old_data = read_memory(out_payload); // out_payload canonized here - trace(9991, "run") << "deep-copy: really writing to " << out_payload.value << ' ' << to_string(out_payload) << " (old value " << to_string(old_data) << " new value " << to_string(data) << ")" << end(); - write_memory(out_payload, data, -1); + payload.value = tmp.value; // now modified for output + vector old_data = read_memory(payload); + trace(9991, "run") << "deep-copy: really writing to " << payload.value << ' ' << to_string(payload) << " (old value " << to_string(old_data) << " new value " << to_string(data) << ")" << end(); + write_memory(payload, data, -1); trace(9991, "run") << "deep-copy: output is " << to_string(data) << end(); return out; } -- cgit 1.4.1-2-gfad0