about summary refs log tree commit diff stats
path: root/cpp/013run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-17 11:23:29 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-17 13:19:20 -0700
commit3ba6357924e1098a28e43c94a4573a3d2978b5e9 (patch)
tree9a5a4b181a82a77646b1c9d796bdd8b4159dc337 /cpp/013run
parent5f0e4762468c412d57fb54236a0ee90e23a2cb14 (diff)
downloadmu-3ba6357924e1098a28e43c94a4573a3d2978b5e9.tar.gz
949 - paving the way for jumps to labels
Addresses for reagents are now computed after all transforms.
Diffstat (limited to 'cpp/013run')
-rw-r--r--cpp/013run4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/013run b/cpp/013run
index 1fc6ded8..102a7dfb 100644
--- a/cpp/013run
+++ b/cpp/013run
@@ -38,6 +38,7 @@ void run(routine rr) {
     // Running one instruction.
     if (instructions[pc].is_label) { ++pc; continue; }
     trace("run") << "instruction " << recipe_name(rr) << '/' << pc;
+//?     cout << instructions[pc].operation << '\n'; //? 1
     switch (instructions[pc].operation) {
       // Primitive Recipe Implementations.
       case COPY: {
@@ -127,7 +128,7 @@ vector<int> read_memory(reagent x) {
 }
 
 void write_memory(reagent x, vector<int> data) {
-  int base = to_int(x.name);
+  int base = x.value;
   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) {
@@ -139,6 +140,7 @@ void write_memory(reagent x, vector<int> data) {
 :(code)
 size_t size_of(reagent r) {
   type_info t = Type[r.types[0]];
+  if (!t.is_record && !t.is_array) return t.size;
   // End size_of Cases.
   return t.size;
 }
c58c38b8703b6818131905a75'>22bb7e35 ^
3dbefa71 ^


22bb7e35 ^
3dbefa71 ^
22bb7e35 ^
3dbefa71 ^
22bb7e35 ^


3dbefa71 ^
22bb7e35 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44