Commit 9dff5dd
Dian-Lun (Aaron) Lin
Solve invalid memory read issue in find_nearest (#112)
This PR addresses the corner cases where neighbor id may be
[max](https://github.com/intel/ScalableVectorSearch/blob/72633231807d46ff59f651916858fa0ed6ba3ee4/include/svs/lib/neighbor.h#L160)
when distance is infinity. In such scenarios, the system could return a
neighbor with the maximum ID, leading to an invalid memory read. To
resolve this, the PR modifies the behavior to reset the ID to the first
index, ensuring a valid existing neighbor is returned.1 parent 7263323 commit 9dff5dd
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
0 commit comments