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-27 18:15:08 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-27 18:15:08 -0700
commitf1a3be1c542120b01fd8273aabf8a674530df981 (patch)
tree777857904f6359259bec31a0ebbb117267d86e7d /cpp/018record
parente2240eb4e89721928fef4e694524e350fb0140cb (diff)
downloadmu-f1a3be1c542120b01fd8273aabf8a674530df981.tar.gz
988 - those replace{} directives were a bad idea
Diffstat (limited to 'cpp/018record')
-rw-r--r--cpp/018record12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/018record b/cpp/018record
index dba43a91..58188813 100644
--- a/cpp/018record
+++ b/cpp/018record
@@ -79,11 +79,11 @@ Recipe_number["get"] = GET;
 assert(Next_recipe_number == GET);
 Next_recipe_number++;
 :(before "End Primitive Recipe Implementations")
-//: beware: overridden in later layers
 case GET: {
   trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name;
-  int base_address = instructions[pc].ingredients[0].value;
-  int base_type = instructions[pc].ingredients[0].types[0];
+  reagent base = instructions[pc].ingredients[0];
+  int base_address = base.value;
+  int base_type = base.types[0];
   assert(Type[base_type].is_record);
   trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name;
   assert(isa_literal(instructions[pc].ingredients[1]));
@@ -93,6 +93,7 @@ case GET: {
     src += size_of(Type[base_type].elements[i]);
   }
   trace("run") << "address to copy is " << src;
+  assert(Type[base_type].is_record);
   assert(Type[base_type].elements.size() > offset);
   int src_type = Type[base_type].elements[offset][0];
   trace("run") << "its type is " << src_type;
@@ -136,8 +137,9 @@ Next_recipe_number++;
 :(before "End Primitive Recipe Implementations")
 case GET_ADDRESS: {
   trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name;
-  int base_address = instructions[pc].ingredients[0].value;
-  int base_type = instructions[pc].ingredients[0].types[0];
+  reagent base = instructions[pc].ingredients[0];
+  int base_address = base.value;
+  int base_type = base.types[0];
   assert(Type[base_type].is_record);
   trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name;
   assert(isa_literal(instructions[pc].ingredients[1]));