Fix build with GCC 11
It seems redundant to array_init() when the structure is zeroed already in the static assignment. But probably the fact that this code juggles between TSTreeCursor and TreeCursor, without using a union, leaves the compiler unable to tell that it's been initialized. Fixes https://github.com/tree-sitter/tree-sitter/issues/853
This commit is contained in:
parent
d5eb5969f9
commit
e13581b041
1 changed files with 1 additions and 0 deletions
|
|
@ -448,6 +448,7 @@ TSTreeCursor ts_tree_cursor_copy(const TSTreeCursor *_cursor) {
|
|||
TSTreeCursor res = {NULL, NULL, {0, 0}};
|
||||
TreeCursor *copy = (TreeCursor *)&res;
|
||||
copy->tree = cursor->tree;
|
||||
array_init(©->stack);
|
||||
array_push_all(©->stack, &cursor->stack);
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue