Branch: Tag:

2017-08-19

2017-08-19 09:45:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Types: Fixed off by one errors in traversal of the type hash table.

The value pike_type_hash_size is misnamed as it is the mask
(and thus one less than the size) of the type hash table.

This fixes a few loops that missed traversing the last bucket of
the type hash table due to handling pike_type_hash_size as a size.

731: Inside #if defined(PIKE_DEBUG)
   return T_STRING;       if (pike_type_hash) -  for (i = 0; i < pike_type_hash_size; i++) +  for (i = 0; i <= pike_type_hash_size; i++)    for (t = pike_type_hash[i]; t; t = t->next)    if (t == (struct pike_type *) something)    return T_TYPE;