Index: sim/common/sim-options.c =================================================================== RCS file: /cvs/src/src/sim/common/sim-options.c,v retrieving revision 1.31 diff -u -p -r1.31 sim-options.c --- sim/common/sim-options.c 3 Sep 2013 20:45:08 -0000 1.31 +++ sim/common/sim-options.c 9 Sep 2013 20:12:25 -0000 @@ -495,6 +495,7 @@ static int dup_arg_p (const char *arg) { int hash; + int table_is_full = 0; static const char **arg_table = NULL; if (arg == NULL) @@ -510,10 +511,15 @@ dup_arg_p (const char *arg) { if (strcmp (arg, arg_table[hash]) == 0) return 1; - /* We assume there won't be more than ARG_HASH_SIZE arguments so we - don't check if the table is full. */ if (++hash == ARG_HASH_SIZE) + { hash = 0; + if (table_is_full++) { + fprintf (stderr, "Internal error - number of options more than %d\n", + ARG_HASH_SIZE); + abort (); + } + } } arg_table[hash] = arg; return 0;