comparison lwasm/lwasm.c @ 216:398773d7e504

Fix crash bug on indexed expression handling Fix NULL pointer deref when simplifying an expression in indexed mode. This fix should eliminate all similar crash bugs.
author William Astle <lost@l-w.ca>
date Sun, 10 Jun 2012 14:10:04 -0600
parents 6f2e18f1fe67
children 7c2c2239ec9c
comparison
equal deleted inserted replaced
215:5330ba70836a 216:398773d7e504
660 return e; 660 return e;
661 } 661 }
662 662
663 int lwasm_reduce_expr(asmstate_t *as, lw_expr_t expr) 663 int lwasm_reduce_expr(asmstate_t *as, lw_expr_t expr)
664 { 664 {
665 lw_expr_simplify(expr, as); 665 if (expr)
666 lw_expr_simplify(expr, as);
666 return 0; 667 return 0;
667 } 668 }
668 669
669 void lwasm_save_expr(line_t *cl, int id, lw_expr_t expr) 670 void lwasm_save_expr(line_t *cl, int id, lw_expr_t expr)
670 { 671 {