about summary refs log tree commit diff stats
path: root/cpp/018record
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/018record')
-rw-r--r--cpp/018record9
1 files changed, 5 insertions, 4 deletions
diff --git a/cpp/018record b/cpp/018record
index f42531be..b6ca40dc 100644
--- a/cpp/018record
+++ b/cpp/018record
@@ -31,15 +31,16 @@ 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 = to_int(instructions[pc].ingredients[0].name);
+  int base_address = instructions[pc].ingredients[0].value;
   int base_type = instructions[pc].ingredients[0].types[0];
   assert(Type[base_type].is_record);
   trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name;
   assert(instructions[pc].ingredients[1].types.size() == 1);
   assert(instructions[pc].ingredients[1].types[0] == 0);  // must be literal
-  size_t offset = to_int(instructions[pc].ingredients[1].name);
+  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]));
@@ -110,13 +111,13 @@ Next_recipe_number++;
 :(before "End Primitive Recipe Implementations")
 case GET_ADDRESS: {
   trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name;
-  int base_address = to_int(instructions[pc].ingredients[0].name);
+  int base_address = instructions[pc].ingredients[0].value;
   int base_type = instructions[pc].ingredients[0].types[0];
   assert(Type[base_type].is_record);
   trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name;
   assert(instructions[pc].ingredients[1].types.size() == 1);
   assert(instructions[pc].ingredients[1].types[0] == 0);  // must be literal
-  size_t offset = to_int(instructions[pc].ingredients[1].name);
+  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]));