Skip to content
  • Philip Withnall's avatar
    gsequence: Squash a static analysis false positive · c4affcb4
    Philip Withnall authored
    
    
    scan-build thinks there can be a `NULL` pointer dereference in `while
    ((i = N_NODES (node->left)) != pos)`, if `node` is `NULL`.
    
    `node` cannot be `NULL`, though, assuming the `n_nodes` member of each
    node in the tree is an accurate count of the number of nodes beneath
    that point. It controls the tree descent and avoids trying to descend
    beneath a leaf.
    
    A static analyser can’t know this though, so let’s add an assertion to
    help.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    Helps: #1767
    c4affcb4