Mercurial > hg-old > index.cgi
comparison lwasm/pseudo.c @ 414:010fb62b9f18
Fixed off by one bug in code generation for fcn
author | lost@l-w.ca |
---|---|
date | Tue, 10 Aug 2010 17:33:56 -0600 |
parents | b30a77f0b685 |
children |
comparison
equal
deleted
inserted
replaced
413:b30a77f0b685 | 414:010fb62b9f18 |
---|---|
281 } | 281 } |
282 | 282 |
283 l -> lstr = lw_strndup(*p, i); | 283 l -> lstr = lw_strndup(*p, i); |
284 (*p) += i + 1; | 284 (*p) += i + 1; |
285 | 285 |
286 l -> len = i; | 286 l -> len = i + 1; |
287 } | 287 } |
288 | 288 |
289 EMITFUNC(pseudo_emit_fcn) | 289 EMITFUNC(pseudo_emit_fcn) |
290 { | 290 { |
291 int i; | 291 int i; |
292 | 292 |
293 for (i = 0; i < l -> len; i++) | 293 for (i = 0; i < (l -> len - 1); i++) |
294 lwasm_emit(l, l -> lstr[i]); | 294 lwasm_emit(l, l -> lstr[i]); |
295 lwasm_emit(l, 0); | 295 lwasm_emit(l, 0); |
296 } | 296 } |
297 | 297 |
298 PARSEFUNC(pseudo_parse_rmb) | 298 PARSEFUNC(pseudo_parse_rmb) |