-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I have some code that returns a vector of ResourcePtrs, but when I try to use these, it results in a segsev boundary error. Before I had the code in the C nif and it worked fine. Snippet of code:
std::vector<fine::ResourcePtr<TSNode>> lst(match.capture_count);
for (int i = 0; i < match.capture_count; ++i) {
lst[i] = fine::make_resource<TSNode>(match.captures[i].node);
}
// TODO: Do we ever need the match id and pattern_index?
return fine::Ok(
std::tuple<uint64_t, uint64_t, std::vector<fine::ResourcePtr<TSNode>>>(
match.id, match.pattern_index, lst));The error fish: Job 1, 'mix test' terminated by signal SIGSEGV (Address boundary error)
The full code is available here: https://codeberg.org/edwinvanl/treesitter_elixir/src/commit/cc104432af4b3765d2e4b557bf6105327bb324c4/src/treesitter_nif.cpp#L234
and the original C nif code: https://codeberg.org/edwinvanl/treesitter_elixir/src/commit/30d57f683876a12de303679636c872b19ec6f0a6/src/treesitter_nif.c#L444
Metadata
Metadata
Assignees
Labels
No labels