aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tcc.c b/tcc.c
index 0bfc5c0..772b171 100644
--- a/tcc.c
+++ b/tcc.c
@@ -8808,6 +8808,10 @@ static void init_putv(CType *type, Section *sec, unsigned long c,
/* XXX: generate error if incorrect relocation */
gen_assign_cast(&dtype);
bt = type->t & VT_BTYPE;
+ /* we'll write at most 12 bytes */
+ if (c + 12 > sec->data_allocated) {
+ section_realloc(sec, c + 12);
+ }
ptr = sec->data + c;
/* XXX: make code faster ? */
if (!(type->t & VT_BITFIELD)) {