• debing.sun's avatar
    Fix crash due to merge of quicklist node introduced by #12955 (#13040) · c34e6484
    debing.sun authored
    Fix two crash introducted by #12955
    
    When a quicklist node can't be inserted and split, we eventually merge
    the current node with its neighboring
    nodes after inserting, and compress the current node and its siblings.
    
    1. When the current node is merged with another node, the current node
    may become invalid and can no longer be used.
    
       Solution: let `_quicklistMergeNodes()` return the merged nodes.
    
    3. If the current node is a LZF quicklist node, its recompress will be
    1. If the split node can be merged with a sibling node to become head or
    tail, recompress may cause the head and tail to be compressed, which is
    not allowed.
    
        Solution: always recompress to 0 after merging.
    
    (cherry picked from commit 1e8dc1da)
    c34e6484
quicklist.c 125 KB