about summary refs log tree commit diff stats
path: root/cpp/019address
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-26 20:24:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-26 20:24:38 -0700
commit3076bab4b62ce2b56c53db6d0b1715429c5bda27 (patch)
tree08c0da74ffee65301953c1186bb7aef1970db16d /cpp/019address
parent62ed0e4728ab0238c47f03dea38782a599bff3fb (diff)
downloadmu-3076bab4b62ce2b56c53db6d0b1715429c5bda27.tar.gz
979
Diffstat (limited to 'cpp/019address')
-rw-r--r--cpp/019address10
1 files changed, 3 insertions, 7 deletions
diff --git a/cpp/019address b/cpp/019address
index be1ce74c..13d59465 100644
--- a/cpp/019address
+++ b/cpp/019address
@@ -49,7 +49,7 @@ bool has_property(reagent x, string name) {
 reagent deref(reagent x) {
 //?   cout << "deref\n"; //? 1
   static const int ADDRESS = Type_number["address"];
-  reagent result("");
+  reagent result;
   assert(x.types[0] == ADDRESS);
 
   // compute value
@@ -110,9 +110,7 @@ case GET: {
   size_t offset = instructions[pc].ingredients[1].value;
   int src = base_address;
   for (size_t i = 0; i < offset; ++i) {
-    reagent tmp;
-    tmp.types.push_back(Type[base_type].elements[i][0]);
-    src += size_of(tmp);
+    src += size_of(Type[base_type].elements[i]);
   }
   trace("run") << "address to copy is " << src;
   assert(Type[base_type].is_record);
@@ -152,9 +150,7 @@ case GET_ADDRESS: {
   size_t offset = instructions[pc].ingredients[1].value;
   int src = base_address;
   for (size_t i = 0; i < offset; ++i) {
-    reagent tmp;
-    tmp.types.push_back(Type[base_type].elements[i][0]);
-    src += size_of(tmp);
+    src += size_of(Type[base_type].elements[i]);
   }
   trace("run") << "address to copy is " << src;
   vector<int> result;