]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - opcodes/ip2k-opc.c
* fr30-opc.c: Regenerate.
[thirdparty/binutils-gdb.git] / opcodes / ip2k-opc.c
index 17a6aba082c598b2b0e3eca38d62de951b8daabb..080f5602506fb18c96eca1bb90d6b430dc9f5956 100644 (file)
@@ -892,7 +892,10 @@ ip2k_cgen_init_opcode_table (CGEN_CPU_DESC cd)
   const CGEN_OPCODE *oc = & ip2k_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];