diff src/lwasm.c @ 94:83ba34ed11b3

Fixed problem with constant expressions evaluating to 0 when they shouldn't
author lost
date Sat, 17 Jan 2009 06:50:49 +0000
parents 34ca1c6e9550
children 81fc353d4d69
line wrap: on
line diff
--- a/src/lwasm.c	Sat Jan 17 06:27:01 2009 +0000
+++ b/src/lwasm.c	Sat Jan 17 06:50:49 2009 +0000
@@ -412,7 +412,7 @@
 		*inp = (char *)ep;
 		if (slot >= 0)
 		{
-			l -> exprends[slot] = ep;
+			l -> exprends[slot] = (char *)ep;
 			l -> exprvals[slot] = lwasm_expr_get_value(s);
 		}
 	}
@@ -427,9 +427,11 @@
 
 	if (s && lwasm_expr_is_constant(s))
 	{
+		*val = lwasm_expr_get_value(s);
 		lwasm_expr_stack_free(s);
 		l -> exprs[slot] = NULL;
 		s = NULL;
+		return 0;
 	}
 
 	if (!s && slot >= 0)