h_cfgrammar_() leaks memory
While valgrinding unit tests and plugging leaks, I found that /core/grammar/end
leaks even if I add h_cfgrammar_free(g)
to test_end()
. The cause is the calls to h_new()
(rather than in the grammar's arena) in if (h_hashset_empty(g->nts))
branch of h_cfgrammar_()
. Unfortunately, these cannot simply be changed over to h_arena_malloc()
calls because the LL(k) backend frees the grammar once it finishes compiling the parser, but apparently keeps some of these pointers around and uses them during parsing. Further investigation proceeding.