about summary refs log tree commit diff stats
path: root/cpp/026new
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-14 18:31:26 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-14 18:31:26 -0700
commit0edf822f996c5def4588cc207d1977cffc3e9a0c (patch)
tree275ee8b5c5f4e96f60f98fa74e546c3899bf9215 /cpp/026new
parente05847550c276debb831eb4853474b0da38614ef (diff)
downloadmu-0edf822f996c5def4588cc207d1977cffc3e9a0c.tar.gz
1062 - bugfix: wasn't aliasing Current_routine
You can't write tests for stupidity.
Diffstat (limited to 'cpp/026new')
-rw-r--r--cpp/026new8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/026new b/cpp/026new
index 9c9bbc04..02196c49 100644
--- a/cpp/026new
+++ b/cpp/026new
@@ -45,7 +45,7 @@ Next_recipe_number++;
 :(before "End Primitive Recipe Implementations")
 case NEW: {
   vector<int> result;
-  result.push_back(Current_routine.alloc);
+  result.push_back(Current_routine->alloc);
   write_memory(instructions[pc].products[0], result);
   vector<int> types;
   types.push_back(instructions[pc].ingredients[0].value);
@@ -53,12 +53,12 @@ case NEW: {
     // array
     vector<int> capacity = read_memory(instructions[pc].ingredients[1]);
     trace("mem") << "array size is " << capacity[0];
-    Memory[Current_routine.alloc] = capacity[0];
-    Current_routine.alloc += capacity[0]*size_of(types);
+    Memory[Current_routine->alloc] = capacity[0];
+    Current_routine->alloc += capacity[0]*size_of(types);
   }
   else {
     // scalar
-    Current_routine.alloc += size_of(types);
+    Current_routine->alloc += size_of(types);
   }
   break;
 }