Don't abort on allocation failures while finishing parse
This commit is contained in:
parent
9657dfcfc3
commit
da4a3f6516
1 changed files with 5 additions and 1 deletions
|
|
@ -93,7 +93,11 @@ typedef enum {
|
|||
|
||||
static StackSlice ts_parser__pop_one(TSParser *self, int head_index, int count) {
|
||||
StackPopResult pop = ts_stack_pop_count(self->stack, head_index, count);
|
||||
assert(pop.status == StackPopSucceeded);
|
||||
if (pop.status != StackPopSucceeded)
|
||||
return (StackSlice){
|
||||
.head_index = -1,
|
||||
.trees = array_new(),
|
||||
};
|
||||
assert(pop.slices.size > 0);
|
||||
assert(pop.slices.contents[0].head_index == head_index);
|
||||
for (size_t i = pop.slices.size - 1; i > 0; i--) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue