Siva Ramaraju - 2022-09-26

Hello Cppcheck team.
Greetings.

For below code snippet, CppCheck reports :
nullPointerRedundantCheck warning, Either the condition '!savedWpointer' is redundant or there is possible null pointer dereference: wildptr.

    assert(savedWpointer);
    wildptr = savedWpointer; // start the wildcard from the last * found 
    exeptr = --savedEpointer; // consume one extra for string
    // now, search for the first instance of the character we are looking for
    // except for '?'
    if (*wildptr != L'?') {
        while((exeptr >= strHexe->u.text) && (*exeptr != *wildptr)) exeptr--;
        savedEpointer = exeptr; // save the position of the exeptr at this branch
    }

There is no redundant check, there is assert(savedWpointer); which is totally valid.
Could you please comment on this nullPointerRedundantCheck warning, seems a false-positive.