• Konstantin Käfer's avatar
    Avoid pointer arithmetic on null pointer to remove undefined behavior · 16872af8
    Konstantin Käfer authored
    The existing checks triggered undefined behavior when the stack was empty (null pointer). This change avoid this:
    * If `stackTop_` and `stackEnd_` are null, it results in a `ptrdiff_t` of `0`
    * If `stackTop_` and `stackEnd_` are valid pointers, they produce a `ptrdiff_t` with the remaining size on the stack
    16872af8
stack.h 7.02 KB