summaryrefslogtreecommitdiff
path: root/gas/config/tc-xstormy16.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-xstormy16.c')
-rw-r--r--gas/config/tc-xstormy16.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c
index 2ea8490821..6ee5be3f51 100644
--- a/gas/config/tc-xstormy16.c
+++ b/gas/config/tc-xstormy16.c
@@ -486,13 +486,14 @@ xstormy16_md_apply_fix (fixS * fixP,
const CGEN_OPERAND *operand = cgen_operand_lookup_by_num (cd, opindex);
const char *errmsg;
bfd_reloc_code_real_type reloc_type;
- CGEN_FIELDS *fields = alloca (CGEN_CPU_SIZEOF_FIELDS (cd));
const CGEN_INSN *insn = fixP->fx_cgen.insn;
/* If the reloc has been fully resolved finish the operand here. */
/* FIXME: This duplicates the capabilities of code in BFD. */
if (fixP->fx_done)
{
+ CGEN_FIELDS *fields = xmalloc (CGEN_CPU_SIZEOF_FIELDS (cd));
+
CGEN_CPU_SET_FIELDS_BITSIZE (cd) (fields, CGEN_INSN_BITSIZE (insn));
CGEN_CPU_SET_VMA_OPERAND (cd) (cd, opindex, fields, (bfd_vma) value);
@@ -516,6 +517,8 @@ xstormy16_md_apply_fix (fixS * fixP,
#endif
if (errmsg)
as_bad_where (fixP->fx_file, fixP->fx_line, "%s", errmsg);
+
+ free (fields);
}
if (fixP->fx_done)