diff lwasm/lwasm.c @ 70:ceab04fd2969

Fixed premature installation of external reference under UNDEFEXTERN pragma; should not resolve to external references until after the initial parsing pass
author lost@l-w.ca
date Sun, 10 Apr 2011 13:15:12 -0600
parents 1bff302e62a3
children 61c084b2c727
line wrap: on
line diff
--- a/lwasm/lwasm.c	Sat Apr 09 01:45:48 2011 -0600
+++ b/lwasm/lwasm.c	Sun Apr 10 13:15:12 2011 -0600
@@ -70,7 +70,7 @@
 	}
 	
 	// check for "undefined" to import automatically
-	if (!im && CURPRAGMA(as -> cl, PRAGMA_UNDEFEXTERN))
+	if ((as -> passno != 0) && !im && CURPRAGMA(as -> cl, PRAGMA_UNDEFEXTERN))
 	{
 		im = lw_alloc(sizeof(importlist_t));
 		im -> symbol = lw_strdup(var);