about summary refs log tree commit diff stats
path: root/cpp/018address
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/018address')
-rw-r--r--cpp/018address6
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];
   }