From 72c4fb2ddacc9fccb8ebe8cba9d1322ddcaac017 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 30 Apr 2015 00:02:54 -0700 Subject: 1226 - bugfix in allocating arrays Also our first test of printing to screen. --- cpp/.traces/interpolate-at-end | 152 ++++++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 76 deletions(-) (limited to 'cpp/.traces/interpolate-at-end') diff --git a/cpp/.traces/interpolate-at-end b/cpp/.traces/interpolate-at-end index 2ea86fe0..35fc4746 100644 --- a/cpp/.traces/interpolate-at-end +++ b/cpp/.traces/interpolate-at-end @@ -98,8 +98,8 @@ run/0: instruction interpolate/14 run/0: {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} mem/0: location 1017 is 10 mem/0: array size is 10 -mem/0: new alloc: 1073 -mem/0: storing 1073 in location 1021 +mem/0: new alloc: 1074 +mem/0: storing 1074 in location 1021 run/0: instruction interpolate/15 run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- copy {name: "0", value: 0, type: 0, properties: ["0": "literal"]} run/0: ingredient 0 is 0 @@ -157,18 +157,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 0 -run/0: address to copy is 1074 -run/0: product 0 is 1074 -mem/0: storing 1074 in location 1027 +run/0: address to copy is 1075 +run/0: product 0 is 1075 +mem/0: storing 1075 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 104 -mem/0: location 1027 is 1074 -mem/0: storing 104 in location 1074 +mem/0: location 1027 is 1075 +mem/0: storing 104 in location 1075 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -226,18 +226,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 1 -run/0: address to copy is 1075 -run/0: product 0 is 1075 -mem/0: storing 1075 in location 1027 +run/0: address to copy is 1076 +run/0: product 0 is 1076 +mem/0: storing 1076 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 101 -mem/0: location 1027 is 1075 -mem/0: storing 101 in location 1075 +mem/0: location 1027 is 1076 +mem/0: storing 101 in location 1076 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -295,18 +295,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 2 -run/0: address to copy is 1076 -run/0: product 0 is 1076 -mem/0: storing 1076 in location 1027 +run/0: address to copy is 1077 +run/0: product 0 is 1077 +mem/0: storing 1077 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 108 -mem/0: location 1027 is 1076 -mem/0: storing 108 in location 1076 +mem/0: location 1027 is 1077 +mem/0: storing 108 in location 1077 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -364,18 +364,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 3 -run/0: address to copy is 1077 -run/0: product 0 is 1077 -mem/0: storing 1077 in location 1027 +run/0: address to copy is 1078 +run/0: product 0 is 1078 +mem/0: storing 1078 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 108 -mem/0: location 1027 is 1077 -mem/0: storing 108 in location 1077 +mem/0: location 1027 is 1078 +mem/0: storing 108 in location 1078 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -433,18 +433,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 4 -run/0: address to copy is 1078 -run/0: product 0 is 1078 -mem/0: storing 1078 in location 1027 +run/0: address to copy is 1079 +run/0: product 0 is 1079 +mem/0: storing 1079 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 111 -mem/0: location 1027 is 1078 -mem/0: storing 111 in location 1078 +mem/0: location 1027 is 1079 +mem/0: storing 111 in location 1079 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -502,18 +502,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 5 -run/0: address to copy is 1079 -run/0: product 0 is 1079 -mem/0: storing 1079 in location 1027 +run/0: address to copy is 1080 +run/0: product 0 is 1080 +mem/0: storing 1080 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 44 -mem/0: location 1027 is 1079 -mem/0: storing 44 in location 1079 +mem/0: location 1027 is 1080 +mem/0: storing 44 in location 1080 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -571,18 +571,18 @@ run/0: jump-if fell through run/0: instruction interpolate/26 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 6 -run/0: address to copy is 1080 -run/0: product 0 is 1080 -mem/0: storing 1080 in location 1027 +run/0: address to copy is 1081 +run/0: product 0 is 1081 +mem/0: storing 1081 in location 1027 run/0: instruction interpolate/27 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 32 -mem/0: location 1027 is 1080 -mem/0: storing 32 in location 1080 +mem/0: location 1027 is 1081 +mem/0: storing 32 in location 1081 run/0: instruction interpolate/28 run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is i @@ -669,18 +669,18 @@ mem/0: storing 97 in location 1025 run/0: instruction interpolate/37 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 7 -run/0: address to copy is 1081 -run/0: product 0 is 1081 -mem/0: storing 1081 in location 1027 +run/0: address to copy is 1082 +run/0: product 0 is 1082 +mem/0: storing 1082 in location 1027 run/0: instruction interpolate/38 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 97 -mem/0: location 1027 is 1081 -mem/0: storing 97 in location 1081 +mem/0: location 1027 is 1082 +mem/0: storing 97 in location 1082 run/0: instruction interpolate/39 run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is j @@ -726,18 +726,18 @@ mem/0: storing 98 in location 1025 run/0: instruction interpolate/37 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 8 -run/0: address to copy is 1082 -run/0: product 0 is 1082 -mem/0: storing 1082 in location 1027 +run/0: address to copy is 1083 +run/0: product 0 is 1083 +mem/0: storing 1083 in location 1027 run/0: instruction interpolate/38 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 98 -mem/0: location 1027 is 1082 -mem/0: storing 98 in location 1082 +mem/0: location 1027 is 1083 +mem/0: storing 98 in location 1083 run/0: instruction interpolate/39 run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is j @@ -783,18 +783,18 @@ mem/0: storing 99 in location 1025 run/0: instruction interpolate/37 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} run/0: ingredient 0 is result -mem/0: location 1021 is 1073 +mem/0: location 1021 is 1074 run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} mem/0: location 1022 is 9 -run/0: address to copy is 1083 -run/0: product 0 is 1083 -mem/0: storing 1083 in location 1027 +run/0: address to copy is 1084 +run/0: product 0 is 1084 +mem/0: storing 1084 in location 1027 run/0: instruction interpolate/38 run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy {name: "in", value: 11, type: 4, properties: ["in": "character"]} run/0: ingredient 0 is in mem/0: location 1025 is 99 -mem/0: location 1027 is 1083 -mem/0: storing 99 in location 1083 +mem/0: location 1027 is 1084 +mem/0: storing 99 in location 1084 run/0: instruction interpolate/39 run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} run/0: ingredient 0 is j @@ -863,24 +863,24 @@ run/0: ingredient 1 is run/0: jumping to instruction 55 run/0: instruction interpolate/56 run/0: reply {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1021 is 1073 -run/0: result 0 is 1073 -mem/0: storing 1073 in location 3 +mem/0: location 1021 is 1074 +run/0: result 0 is 1074 +mem/0: storing 1074 in location 3 run/0: instruction test-interpolate-at-end/3 run/0: {name: "4", value: 4, type: 5-4, properties: ["4": "array":"character", "raw": ]} <- copy {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} run/0: ingredient 0 is 3 -mem/0: location 3 is 1073 -mem/0: location 1073 is 10 -mem/0: location 1074 is 104 -mem/0: location 1075 is 101 -mem/0: location 1076 is 108 +mem/0: location 3 is 1074 +mem/0: location 1074 is 10 +mem/0: location 1075 is 104 +mem/0: location 1076 is 101 mem/0: location 1077 is 108 -mem/0: location 1078 is 111 -mem/0: location 1079 is 44 -mem/0: location 1080 is 32 -mem/0: location 1081 is 97 -mem/0: location 1082 is 98 -mem/0: location 1083 is 99 +mem/0: location 1078 is 108 +mem/0: location 1079 is 111 +mem/0: location 1080 is 44 +mem/0: location 1081 is 32 +mem/0: location 1082 is 97 +mem/0: location 1083 is 98 +mem/0: location 1084 is 99 mem/0: storing 10 in location 4 mem/0: storing 104 in location 5 mem/0: storing 101 in location 6 -- cgit 1.4.1-2-gfad0