changeset 412:35a0b086bf4a

Added dummy .bank pseudo and fixed segfault in output for object target (on imported symbol)
author lost@l-w.ca
date Mon, 09 Aug 2010 00:37:46 -0600
parents cac204676434
children b30a77f0b685
files lwasm/instab.c lwasm/output.c lwasm/section.c
diffstat 3 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/instab.c	Mon Aug 09 00:10:24 2010 -0600
+++ b/lwasm/instab.c	Mon Aug 09 00:37:46 2010 -0600
@@ -672,6 +672,7 @@
 	{ "nam",		{	-1, 	-1, 	-1, 	-1 },	pseudo_parse_noop,		pseudo_resolve_noop,			pseudo_emit_noop,			lwasm_insn_normal},
 	{ "pag",		{	-1, 	-1, 	-1, 	-1 },	pseudo_parse_noop,		pseudo_resolve_noop,			pseudo_emit_noop,			lwasm_insn_normal},
 	{ "ttl",		{	-1, 	-1, 	-1, 	-1 },	pseudo_parse_noop,		pseudo_resolve_noop,			pseudo_emit_noop,			lwasm_insn_normal},
+	{ ".bank",		{	-1, 	-1, 	-1, 	-1 },	pseudo_parse_noop,		pseudo_resolve_noop,			pseudo_emit_noop,			lwasm_insn_normal},
 
 	// flag end of table
 	{ NULL,			{	-1, 	-1, 	-1, 	-1 },	NULL,					NULL,							lwasm_insn_normal}
--- a/lwasm/output.c	Mon Aug 09 00:10:24 2010 -0600
+++ b/lwasm/output.c	Mon Aug 09 00:37:46 2010 -0600
@@ -493,6 +493,8 @@
 			lw_expr_t te;
 			line_t tl;
 			
+			if (ex -> se == NULL)
+				continue;
 			if (ex -> se -> section != s)
 				continue;
 			te = lw_expr_copy(ex -> se -> value);
--- a/lwasm/section.c	Mon Aug 09 00:10:24 2010 -0600
+++ b/lwasm/section.c	Mon Aug 09 00:37:46 2010 -0600
@@ -53,7 +53,7 @@
 	if (as -> csect)
 	{
 		lw_expr_destroy(as -> csect -> offset);
-		as -> csect -> offset = l -> addr;
+		as -> csect -> offset = lw_expr_copy(l -> addr);
 		as -> csect = NULL;
 	}