Skip to content

Fix unnecessarily retained pointer to rules parameter in llama_grammar_init#6003

Merged
ggerganov merged 1 commit intoggml-org:masterfrom
gliptic:fix_pointer_to_parameter
Mar 11, 2024
Merged

Fix unnecessarily retained pointer to rules parameter in llama_grammar_init#6003
ggerganov merged 1 commit intoggml-org:masterfrom
gliptic:fix_pointer_to_parameter

Conversation

@gliptic
Copy link
Copy Markdown
Contributor

@gliptic gliptic commented Mar 11, 2024

llama_grammar_init unnecessarily retains a pointer from the rules array even though it has been copied, making it necessary to keep rules alive after the call has returned (or segfault in my case...).

This fix simply uses a pointer to the copy instead.

@ggerganov ggerganov merged commit 5cdb371 into ggml-org:master Mar 11, 2024
@gliptic gliptic deleted the fix_pointer_to_parameter branch March 11, 2024 20:01
NeoZhangJianyu pushed a commit to NeoZhangJianyu/llama.cpp that referenced this pull request Mar 12, 2024
jordankanter pushed a commit to jordankanter/llama.cpp that referenced this pull request Mar 13, 2024
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
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