Skip to content

Fix unnecessarily retained pointer to rules parameter in llama_grammar_init #6003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

gliptic
Copy link
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
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 1, 2024
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