changeset 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 5330ba70836a
children f87c86668d6b
files lwasm/lwasm.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/lwasm.c	Sun Jun 10 13:29:23 2012 -0600
+++ b/lwasm/lwasm.c	Sun Jun 10 14:10:04 2012 -0600
@@ -662,7 +662,8 @@
 
 int lwasm_reduce_expr(asmstate_t *as, lw_expr_t expr)
 {
-	lw_expr_simplify(expr, as);
+	if (expr)
+		lw_expr_simplify(expr, as);
 	return 0;
 }