comparison src/lwasm.c @ 84:e12edcfbebd5

Fixed problem with expression evaluation infrastructure not advancing input pointer on pass 2
author lost
date Wed, 14 Jan 2009 07:04:45 +0000
parents d0ce3f5f6797
children ea2cfebef5d0
comparison
equal deleted inserted replaced
83:964d68cde469 84:e12edcfbebd5
400 return -1; 400 return -1;
401 } 401 }
402 *inp = (char *)ep; 402 *inp = (char *)ep;
403 if (slot >= 0) 403 if (slot >= 0)
404 { 404 {
405 l -> exprends[slot] = *inp; 405 l -> exprends[slot] = ep;
406 l -> exprvals[slot] = lwasm_expr_get_value(s); 406 l -> exprvals[slot] = lwasm_expr_get_value(s);
407 } 407 }
408 } 408 }
409 else if (l -> exprs[slot]) 409 else if (l -> exprs[slot])
410 { 410 {
411 s = l -> exprs[slot]; 411 s = l -> exprs[slot];
412 *inp = l -> exprends[slot];
413 lwasm_reevaluate_expr(as, l, s); 412 lwasm_reevaluate_expr(as, l, s);
414 l -> exprvals[slot] = lwasm_expr_get_value(s); 413 l -> exprvals[slot] = lwasm_expr_get_value(s);
415 } 414 }
415 if (as -> passnum == 2 && slot >= 0)
416 *inp = l -> exprends[slot];
416 417
417 if (s && lwasm_expr_is_constant(s)) 418 if (s && lwasm_expr_is_constant(s))
418 { 419 {
419 lwasm_expr_stack_free(s); 420 lwasm_expr_stack_free(s);
420 l -> exprs[slot] = NULL; 421 l -> exprs[slot] = NULL;