comparison 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
comparison
equal deleted inserted replaced
69:87026ec7e1c2 70:ceab04fd2969
68 if (!strcmp(im -> symbol, var)) 68 if (!strcmp(im -> symbol, var))
69 break; 69 break;
70 } 70 }
71 71
72 // check for "undefined" to import automatically 72 // check for "undefined" to import automatically
73 if (!im && CURPRAGMA(as -> cl, PRAGMA_UNDEFEXTERN)) 73 if ((as -> passno != 0) && !im && CURPRAGMA(as -> cl, PRAGMA_UNDEFEXTERN))
74 { 74 {
75 im = lw_alloc(sizeof(importlist_t)); 75 im = lw_alloc(sizeof(importlist_t));
76 im -> symbol = lw_strdup(var); 76 im -> symbol = lw_strdup(var);
77 im -> next = as -> importlist; 77 im -> next = as -> importlist;
78 as -> importlist = im; 78 as -> importlist = im;