comparison lwasm/list.c @ 542:f3018ed5e30e

Fix listing to not rely on undefined memory before the start of instab This is exactly the same bug that affected symbol value registration and was fixed in changeset 65c2085e0398. This time, fix it when creating listings.
author William Astle <lost@l-w.ca>
date Wed, 17 Aug 2022 17:06:30 -0600
parents 10f62dc61a75
children 3a173cefc814
comparison
equal deleted inserted replaced
541:5fb1110c043f 542:f3018ed5e30e
179 } 179 }
180 } 180 }
181 else 181 else
182 { 182 {
183 lw_expr_t te; 183 lw_expr_t te;
184 if (instab[cl -> insn].flags & lwasm_insn_setdata) 184 if ((cl -> insn >= 0) && (instab[cl -> insn].flags & lwasm_insn_setdata))
185 te = lw_expr_copy(cl -> daddr); 185 te = lw_expr_copy(cl -> daddr);
186 else 186 else
187 te = lw_expr_copy(cl -> addr); 187 te = lw_expr_copy(cl -> addr);
188 as -> exportcheck = 1; 188 as -> exportcheck = 1;
189 as -> csect = cl -> csect; 189 as -> csect = cl -> csect;