The simplest code to reproduce this bug seems to be int a[][] = {{1,1,1,1,1,1,1}};
Unified · Split
| @@ -8808,6 +8808,10 @@ static void init_putv(CType *type, Section *sec, unsigned long c, · 8807 unmodified lines | ||
| 8808 | 8808 | /* XXX: generate error if incorrect relocation */ |
| 8809 | 8809 | gen_assign_cast(&dtype); |
| 8810 | 8810 | bt = type->t & VT_BTYPE; |
| 8811 | + /* we'll write at most 12 bytes */ | |
| 8812 | + if (c + 12 > sec->data_allocated) { | |
| 8813 | + section_realloc(sec, c + 12); | |
| 8814 | + } | |
| 8811 | 8815 | ptr = sec->data + c; |
| 8812 | 8816 | /* XXX: make code faster ? */ |
| 8813 | 8817 | if (!(type->t & VT_BITFIELD)) { |