Skip to content

Commit

Permalink
speculative : fix out-of-bounds access (#10289)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov authored Nov 14, 2024
1 parent af148c9 commit 2a82891
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/speculative/speculative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,12 @@ int main(int argc, char ** argv) {
for (size_t i = 0; i < dist_tgt.size; i++) {
if (dist_tgt.data[i].id == drafts[s].tokens[i_dft]) {
p_tgt = dist_tgt.data[i].p;
break;
}
}
for (size_t i = 0; i < dist_dft.size; i++) {
if (dist_dft.data[i].id == drafts[s].tokens[i_dft]) {
p_dft = dist_dft.data[i].p;
}
if (p_tgt && p_dft) {
break;
}
}
Expand Down

0 comments on commit 2a82891

Please sign in to comment.