about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-09 20:03:18 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-09 20:03:18 -0700
commit957ca9c955751d4454e7b4095f903eead9b678cc (patch)
tree2cba51b4ea76706b29879f9cc644062005683150
parent65d5fb17b61ab9252137e0eb7e8ff5a1c88e376c (diff)
downloadmu-957ca9c955751d4454e7b4095f903eead9b678cc.tar.gz
2269
Another bugfix. Thanks Jack and Caleb Couch.
-rw-r--r--081run_interactive.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/081run_interactive.cc b/081run_interactive.cc
index 81c49d42..dc46cf1f 100644
--- a/081run_interactive.cc
+++ b/081run_interactive.cc
@@ -286,6 +286,17 @@ get x:number, foo:offset]
 +mem: storing 110 in location 14
 # ...
 
+:(scenario run_interactive_with_comment)
+recipe main [
+  # 2 instructions, with a comment after the first
+  1:address:array:number <- new [a:number <- copy 0  # abc
+b:number <- copy 0
+]
+  2:address:array:character, 3:address:array:character <- run-interactive 1:address:array:character
+]
+# no errors
++mem: storing 0 in location 3
+
 :(before "End Globals")
 string Most_recent_products;
 :(before "End Setup")
@@ -330,7 +341,7 @@ string strip_comments(string in) {
       result << in.at(i);
     }
     else {
-      while (i < SIZE(in) && in.at(i) != '\n')
+      while (i+1 < SIZE(in) && in.at(i+1) != '\n')
         ++i;
     }
   }
id='n152' href='#n152'>152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252