• Bug#166316: sgrep: Assert violated common.c:845

    From Chris Hofstaedtler@21:1/5 to [email protected] on Sun Jul 13 15:50:01 2025
    Control: found -1 1.94a-7+b1

    On Fri, Oct 25, 2002 at 02:11:06PM +0200, [email protected] wrote:
    - Launching the command
    ./sgrep -o "\n%r\n" 'FIRST_IN(("if" .. ("(" .. ")")), "if" not in (C_COMMENTS
    or C_PREPROCS) .. ("(" .. ")"))' file.c

    - On the following file (file.c):
    #ifdef
    #else
    #define
    #endif
    #ifdef
    #else
    #define F (param)
    #endif
    C();
    C();
    if (C) {
    }

    - Leads to the following error message:
    sgrep: common.c:845: check_add_region: Assertion `l->length==0 || l->sorted!=START_SORTED || ((l)->last->list[(l)->length-1]).start<s || (((l)->last->list[(l)->length-1]).start=\=s && ((l)->last->list[(l)->length-1]).end<e)' failed.
    Aborted (core dumped)

    Indeed.

    sgrep: common.c:801: check_add_region: Assertion `l->length==0 || l->sorted!=START_SORTED || LAST_NODE(l).start<s || (LAST_NODE(l).start==s && LAST_NODE(l).end<e)' failed.
    [1] 406867 abort (core dumped) sgrep -o "\n%r\n" file.c

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)