run_accel() passed c_end - 1 to shuftiDoubleExec().
shuftiDoubleExecReal already handles the last-byte boundary internally
via check_last_byte(), so shortening the buffer caused it to miss
valid matches near the end and apply the wildcard check to the wrong
byte. Changed to pass c_end.
Fixes: ca70a3d9beca61b58c6709fead60ec662482d36e ("Fix double shufti's
vector end false positive (#325)")
Signed-off-by: Byeonguk Jeong <jungbu2855@gmail.com>
* shufti-double: Preserve first_char_mask after peel-off
first_char_mask was reset to Ones() after the peel-off block,
discarding carry-over state for cross-boundary pattern detection.
Remove the reset.
Fixes: ca70a3d9beca61b58c6709fead60ec662482d36e ("Fix double shufti's
vector end false positive (#325)")
Add three tests exercising the double shufti edge cases.
- ExecMatchVectorEdge: Two-byte pair ("ab") spanning the peel-off to
aligned block boundary is correctly detected. Validates that
first_char_mask state carries over and is not reset after peel-off.
- ExecNoMatchLastByte: First character of a double-byte pair ('x' from
"xy") at the last buffer byte does not cause a false positive when
the second character is absent.
- ExecMatchLastByte: Single-byte pattern ('a') at the last buffer byte
is detected via check_last_byte's reduce.