Skip to content

Commit

Permalink
Fix: _sz_find_3byte_serial overflow
Browse files Browse the repository at this point in the history
Closes #177

Co-authored-by: Aleksandr Slepnev <keyn409@gmail.com>
Co-authored-by: Aleksandr Slepnev <84568706+Keynib@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 15, 2024
1 parent 2a54b6a commit c6d9b47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/stringzilla/stringzilla.h
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@ SZ_INTERNAL sz_cptr_t _sz_find_3byte_serial(sz_cptr_t h, sz_size_t h_length, sz_
sz_u64_vec_t matches0_vec, matches1_vec, matches2_vec, matches3_vec, matches4_vec;
sz_u64_vec_t n_vec;
n_vec.u64 = 0;
n_vec.u8s[0] = n[0], n_vec.u8s[1] = n[1], n_vec.u8s[2] = n[2], n_vec.u8s[3] = n[3];
n_vec.u8s[0] = n[0], n_vec.u8s[1] = n[1], n_vec.u8s[2] = n[2];
n_vec.u64 *= 0x0000000001000001ull; // broadcast

// This code simulates hyper-scalar execution, analyzing 8 offsets at a time using three 64-bit words.
Expand Down

0 comments on commit c6d9b47

Please sign in to comment.