prism icon indicating copy to clipboard operation
prism copied to clipboard

Assertion failed in pm_newline_list_append

Open stevenjohnstone opened this issue 1 month ago • 0 comments

On 1da0733f147ed0a4547791576db53c04780cd498,

#include <prism.h>

/*
00000000: 250a 237b 3c3c 307d 0a00                 %.#{<<0}..
*/

uint8_t input[] = {
  0x25, 0x0a, 0x23, 0x7b, 0x3c, 0x3c, 0x30, 0x7d, 0x0a, 0x00
};

int main(int argc, const char **argv) {
    (void) argc;
    (void) argv;
    pm_parse_success_p(input, sizeof(input), NULL);
    return 0;
}

built with

$ clang -Iinclude $(find src -name "*.c") -ggdb3 testcase.c -fsanitize=address -o testcase

gives

$ ./testcase
testcase: src/util/pm_newline_list.c:51: _Bool pm_newline_list_append(pm_newline_list_t *, const uint8_t *): Assertion `list->size == 0 || newline_offset > list->offsets[list->size - 1]' failed.
Aborted

stevenjohnstone avatar Nov 25 '25 15:11 stevenjohnstone