diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-07-03 02:20:54 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-07-03 02:20:54 -0700 |
commit | 1bdb79d0ea3954ab5a2a027041f09bb42170c0d5 (patch) | |
tree | 7073477f0db34b9a604f5c22da96d2a09e1b71d0 | |
parent | 07a7eeffa06cd6e3e54a519dd735896faa5b6727 (diff) | |
download | mu-1bdb79d0ea3954ab5a2a027041f09bb42170c0d5.tar.gz |
3090
-rw-r--r-- | 073deep_copy.cc | 9 |
1 files 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<int, int>& addresses_copi trace(9991, "run") << "recursing on payload " << payload.value << ' ' << to_string(payload) << end(); vector<double> 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<double> 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<double> 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; } |