Increase size of ref_counts and add assertions
This bumps the size of the reference counts from 16- to 32-bit counters to make it less likely to overflow. Also assert in the retain function that the reference count didn't overflow. 32-bits seems big enough for non-pathological examples but a more fool-proof fix may be to bump it to 64-bits.
This commit is contained in:
parent
839dc53bf2
commit
5ef9c4d6aa
3 changed files with 5 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ typedef struct Tree {
|
|||
TSLexMode lex_mode;
|
||||
} first_leaf;
|
||||
|
||||
unsigned short ref_count;
|
||||
uint32_t ref_count;
|
||||
bool visible : 1;
|
||||
bool named : 1;
|
||||
bool extra : 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue