vt: fix ASAN UB warning

../vt.c:648:13: runtime error: signed integer overflow: 3924432811 * 2654435761 cannot be represented in type 'long'
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../vt.c:648:13 in

Closes #1456
This commit is contained in:
Daniel Eklöf 2023-08-05 07:19:51 +02:00
parent 90ad3d6491
commit 12e0edd6e1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
vt.c
View file

@ -645,7 +645,7 @@ chain_key(uint32_t old_key, uint32_t new_wc)
new_key ^= new_wc; new_key ^= new_wc;
/* Multiply with magic hash constant */ /* Multiply with magic hash constant */
new_key *= 2654435761; new_key *= 2654435761ul;
/* And mask, to ensure the new value is within range */ /* And mask, to ensure the new value is within range */
new_key &= CELL_COMB_CHARS_HI - CELL_COMB_CHARS_LO; new_key &= CELL_COMB_CHARS_HI - CELL_COMB_CHARS_LO;