comparison lwasm/pragma.c @ 56:337301ddf74a

Fixed error with pragma and *pragma directives
author lost@l-w.ca
date Wed, 06 Apr 2011 00:12:01 -0600
parents cb4efc47ce9d
children 428068681cbf
comparison
equal deleted inserted replaced
55:bad2ee25acdd 56:337301ddf74a
104 for (t = *p; *t && !isspace(*t); t++) 104 for (t = *p; *t && !isspace(*t); t++)
105 /* do nothing */ ; 105 /* do nothing */ ;
106 106
107 ps = lw_strndup(*p, t - *p); 107 ps = lw_strndup(*p, t - *p);
108 *p = t; 108 *p = t;
109
110 l -> len = 0;
109 111
110 if (parse_pragma_string(as, ps, 0) == 0) 112 if (parse_pragma_string(as, ps, 0) == 0)
111 { 113 {
112 lwasm_register_error(as, l, "Unrecognized pragma string"); 114 lwasm_register_error(as, l, "Unrecognized pragma string");
113 } 115 }
122 /* do nothing */ ; 124 /* do nothing */ ;
123 125
124 ps = lw_strndup(*p, t - *p); 126 ps = lw_strndup(*p, t - *p);
125 *p = t; 127 *p = t;
126 128
129 l -> len = 0;
130
127 // *pragma must NEVER throw an error 131 // *pragma must NEVER throw an error
128 parse_pragma_string(as, ps, 1); 132 parse_pragma_string(as, ps, 1);
129 lw_free(ps); 133 lw_free(ps);
130 } 134 }