Commit edab5d2
Add error for overflowing nbits during PQ construction (#3833)
Summary:
Pull Request resolved: #3833
size_t expands to unsigned long int, so any left shift more than 31 means ksub overflows. So, we can add a check right before it is constructed in ProductQuantizer.
Ramil talked to Matthijs and got to understand that over 16 bits isn't really practical, but we can do 24 to be safe.
Reviewed By: mengdilin
Differential Revision: D621538811 parent d296b2c commit edab5d2
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
0 commit comments