about summary refs log tree commit diff stats
path: root/cpp/012run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-21 21:53:41 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-21 21:53:41 -0800
commitfe67d47aa4598497e295510cf27f702a3e118632 (patch)
treeda8d72108543168dc6c0ceee252fa82158639582 /cpp/012run
parent35e535712d43031d97a5da5fcbc38fb946c0b9dd (diff)
downloadmu-fe67d47aa4598497e295510cf27f702a3e118632.tar.gz
810
Diffstat (limited to 'cpp/012run')
-rw-r--r--cpp/012run6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/012run b/cpp/012run
index 63ffdff1..946b01d1 100644
--- a/cpp/012run
+++ b/cpp/012run
@@ -59,7 +59,7 @@ vector<int> read_memory(reagent x) {
 
 void write_memory(reagent x, vector<int> data) {
   int base = to_int(x.name);
-  size_t size = size_of(x.types[0]);
+  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) {
     trace("mem") << "storing in location " << base+offset;
@@ -75,8 +75,8 @@ int to_int(string n) {
   return result;
 }
 
-int size_of(type_number x) {
-  type_info t = Type[x];
+int size_of(reagent r) {
+  type_info t = Type[r.types[0]];
   if (!t.is_record && !t.is_array) return t.size;
   return t.size;  // TODO
 }