* src/intervals.c (set_intervals_multibyte_1): Fix bug#61887

When `total_length` is 0 there should be no subtree at all, but
`delete_interval` only deletes one interval, so make sure we don't end
up with some stale child of `i`.
This commit is contained in:
Stefan Monnier 2023-03-03 19:13:03 -05:00
parent b3e930d328
commit adc04ad524

View file

@ -2333,6 +2333,9 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag,
if (TOTAL_LENGTH (i) == 0)
{
/* Delete the whole subtree. */
i->left = NULL;
i->right = NULL;
delete_interval (i);
return;
}