aboutsummaryrefslogtreecommitdiff
path: root/opcodes/frv-opc.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/frv-opc.c')
-rw-r--r--opcodes/frv-opc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/opcodes/frv-opc.c b/opcodes/frv-opc.c
index e474a0b..f1a20e5 100644
--- a/opcodes/frv-opc.c
+++ b/opcodes/frv-opc.c
@@ -6223,7 +6223,10 @@ frv_cgen_init_opcode_table (CGEN_CPU_DESC cd)
const CGEN_OPCODE *oc = & frv_cgen_macro_insn_opcode_table[0];
CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
- memset (insns, 0, num_macros * sizeof (CGEN_INSN));
+ /* This test has been added to avoid a warning generated
+ if memset is called with a third argument of value zero. */
+ if (num_macros >= 1)
+ memset (insns, 0, num_macros * sizeof (CGEN_INSN));
for (i = 0; i < num_macros; ++i)
{
insns[i].base = &ib[i];