Skip to content

UPSTREAM PR #20445: tests: Fix invalid iterator::end() dereference in common_regex - #1258

Open
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-20445-fix-invalid-iterator-dereference
Open

UPSTREAM PR #20445: tests: Fix invalid iterator::end() dereference in common_regex#1258
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-20445-fix-invalid-iterator-dereference

Conversation

@loci-dev

Copy link
Copy Markdown

Note

Source pull request: ggml-org/llama.cpp#20445

When compiling with VS2026 18.4 I noticed test-regex-partial crashes immediately with debug build.

image

I tracked this down to an iterator::end() dereference in the following test case which was occurring here.

    assert_equals<std::string>(
        "^(a*)",
        regex_to_reversed_partial_regex("a*"));

This fix adds bounds checking to prevent such dereferencing.

@loci-review

loci-review Bot commented Mar 16, 2026

Copy link
Copy Markdown

No meaningful performance changes were detected across 120084 analyzed functions in the following binaries: build.bin.libllama.so, build.bin.llama-tts, build.bin.llama-cvector-generator, build.bin.libmtmd.so, build.bin.llama-bench, build.bin.libggml-base.so, build.bin.libggml-cpu.so, build.bin.libggml.so, build.bin.llama-quantize, build.bin.llama-qwen2vl-cli, build.bin.llama-tokenize, build.bin.llama-gemma3-cli, build.bin.llama-gguf-split, build.bin.llama-llava-cli, build.bin.llama-minicpmv-cli.

🔎 Full breakdown: Loci Inspector
💬 Questions? Tag @loci-dev

@loci-dev
loci-dev force-pushed the main branch 12 times, most recently from 59f2b25 to d63964d Compare March 24, 2026 02:17
@loci-dev
loci-dev force-pushed the main branch 9 times, most recently from 8fec234 to 82160d6 Compare March 31, 2026 02:17
@loci-dev
loci-dev force-pushed the main branch 6 times, most recently from a67a372 to 6ef937b Compare April 4, 2026 02:17
@loci-dev
loci-dev force-pushed the main branch 8 times, most recently from 34734bc to 55afbee Compare April 11, 2026 02:17
@loci-dev
loci-dev force-pushed the main branch 9 times, most recently from d101579 to 63ab8d1 Compare April 18, 2026 02:17
@loci-dev
loci-dev force-pushed the main branch 2 times, most recently from 7638ab4 to f1b46d5 Compare April 20, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants