diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-02-21 22:08:58 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-02-21 22:08:58 -0800 |
commit | d160a8e170ed5488b91c6a9d5e46546d8132233b (patch) | |
tree | 2e3b66cdcdea3732a1d3096e1e97924180cb27f0 /cpp/018address | |
parent | fe67d47aa4598497e295510cf27f702a3e118632 (diff) | |
download | mu-d160a8e170ed5488b91c6a9d5e46546d8132233b.tar.gz |
811 - first test for arrays
Diffstat (limited to 'cpp/018address')
-rw-r--r-- | cpp/018address | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/018address b/cpp/018address index 32214761..5e53a8ce 100644 --- a/cpp/018address +++ b/cpp/018address @@ -43,9 +43,9 @@ recipe main [ void write_memory(reagent x, vector<int> data) { x = canonize(x); int base = to_int(x.name); - size_t size = size_of(x); - if (size != data.size()) raise << "size mismatch in storing to " << x.to_string(); - for (size_t offset = 0; offset < size; ++offset) { + if (!Type[x.types[0]].is_array && size_of(x) != data.size()) + raise << "size mismatch in storing to " << x.to_string(); + for (size_t offset = 0; offset < data.size(); ++offset) { trace("mem") << "storing in location " << base+offset; Memory[base+offset] = data[offset]; } |