]> git.eshelyaron.com Git - emacs.git/commitdiff
fix possible infinite loop in find_filename_hash_slot
authorTom Tromey <tom@tromey.com>
Sat, 20 Jan 2018 22:09:40 +0000 (15:09 -0700)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 8 Dec 2020 20:54:02 +0000 (22:54 +0200)
lib-src/etags.c

index 90332e76ad9e41ae2257e7dcab3742a16fe54fc4..92cc190f3e6ce2a485c106fcf770e30687f312ae 100644 (file)
@@ -7714,8 +7714,7 @@ find_filename_hash_slot (const char *filename)
          || streq (filename_hash_table[index], filename))
        return &filename_hash_table[index];
 
-      /* Add 1 because, if VAL==0, we won't advance.  */
-      index = (index + val + 1) % filename_hash_size;
+      index = (index + 3) % filename_hash_size;
     }
 }