comparison lwasm/section.c @ 178:35f7ce3ef857

Fix stupid thinko when making all instances of a constant section start at 0
author lost@l-w.ca
date Fri, 09 Sep 2011 22:08:07 -0600
parents 872fa82680e1
children 8764142b3192
comparison
equal deleted inserted replaced
177:f8b07153abc4 178:35f7ce3ef857
138 as -> sections = s; 138 as -> sections = s;
139 } 139 }
140 140
141 // cause all instances of "constant" sections to start at 0 141 // cause all instances of "constant" sections to start at 0
142 if (s -> flags & section_flag_constant) 142 if (s -> flags & section_flag_constant)
143 s -> offset = 0; 143 s -> offset = lw_expr_build(lw_expr_type_int, 0);
144 lw_expr_destroy(l -> addr); 144 lw_expr_destroy(l -> addr);
145 l -> addr = lw_expr_copy(s -> offset); 145 l -> addr = lw_expr_copy(s -> offset);
146 lw_expr_destroy(l -> daddr); 146 lw_expr_destroy(l -> daddr);
147 l -> daddr = lw_expr_copy(s -> offset); 147 l -> daddr = lw_expr_copy(s -> offset);
148 as -> csect = s; 148 as -> csect = s;