diff 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
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;
 }