about summary refs log tree commit diff stats
path: root/cpp/018record
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-25 19:06:32 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-25 19:47:17 -0700
commite853b94e93f0a525c857eff97b5ed3d7e9fecdac (patch)
treea91449a1497a7cbb3433cb41d8d10c966a0c809e /cpp/018record
parent6de26237ff5c596084caea6e0a9158c22692f566 (diff)
downloadmu-e853b94e93f0a525c857eff97b5ed3d7e9fecdac.tar.gz
971
Diffstat (limited to 'cpp/018record')
-rw-r--r--cpp/018record11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/018record b/cpp/018record
index 44e568cc..64cedb7a 100644
--- a/cpp/018record
+++ b/cpp/018record
@@ -44,14 +44,17 @@ case GET: {
   size_t offset = instructions[pc].ingredients[1].value;
   int src = base_address;
   for (size_t i = 0; i < offset; ++i) {
-    src += size_of(reagent(Type[base_type].elements[i][0]));
+    reagent tmp;
+    tmp.types.push_back(Type[base_type].elements[i][0]);
+    src += size_of(tmp);
   }
   trace("run") << "address to copy is " << src;
   assert(Type[base_type].elements.size() > offset);
   int src_type = Type[base_type].elements[offset][0];
   trace("run") << "its type is " << src_type;
-  reagent tmp(src_type);
+  reagent tmp;
   tmp.set_value(src);
+  tmp.types.push_back(src_type);
   vector<int> result(read_memory(tmp));
   trace("run") << "product 0 is " << result[0];
   write_memory(instructions[pc].products[0], result);
@@ -120,7 +123,9 @@ case GET_ADDRESS: {
   size_t offset = instructions[pc].ingredients[1].value;
   int src = base_address;
   for (size_t i = 0; i < offset; ++i) {
-    src += size_of(reagent(Type[base_type].elements[i][0]));
+    reagent tmp;
+    tmp.types.push_back(Type[base_type].elements[i][0]);
+    src += size_of(tmp);
   }
   trace("run") << "address to copy is " << src;
   vector<int> result;