From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 4be666d6 for ; Wed, 29 Nov 2017 15:17:30 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1eK8nR-0000re-3v; Wed, 29 Nov 2017 21:17:29 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1eK8nQ-0001I2-N0; Wed, 29 Nov 2017 21:17:28 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1eK8nP-00018t-NT; Wed, 29 Nov 2017 21:17:27 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id f4729391; Wed, 29 Nov 2017 21:17:28 +0100 (CET) Date: Wed, 29 Nov 2017 21:17:28 +0100 From: Ingo Schwarze To: "Anthony J. Bentley" Cc: tech@mandoc.bsd.lv Subject: Re: assertion "nit->head->child == NULL" failed Message-ID: <20171129201728.GC15639@athene.usta.de> References: <8495.1511344149@cathet.us> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8495.1511344149@cathet.us> User-Agent: Mutt/1.8.0 (2017-02-23) Hi Anthony, Anthony J. Bentley wrote on Wed, Nov 22, 2017 at 02:49:09AM -0700: > .Dd > .Bl -offset indent -column local > .It x > .El > > (gdb) run tmp.d8X8GXiA24 > Starting program: /usr/bin/mandoc tmp.d8X8GXiA24 > assertion "nit->head->child == NULL" failed: > file "mdoc_validate.c", line 1503, function "post_it" Oops, i broke that quite some time ago when moving the validation phase after the parsing phase. Fixed by the commit below. Thanks for reporting! Ingo Log Message: ----------- Recognize .Bl -column at parse time, and not only at validation time, even if other arguments precede -column. This is required because the .It parser needs to know whether or not we are a -column list. Fixes tree corruption leading to an assertion failure. Bug reported by bentley@. Modified Files: -------------- mandoc: mdoc_state.c Revision Data ------------- Index: mdoc_state.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mdoc_state.c,v retrieving revision 1.8 retrieving revision 1.9 diff -Lmdoc_state.c -Lmdoc_state.c -u -p -r1.8 -r1.9 --- mdoc_state.c +++ mdoc_state.c @@ -208,19 +208,24 @@ state_bd(STATE_ARGS) static void state_bl(STATE_ARGS) { + struct mdoc_arg *args; + size_t i; if (n->type != ROFFT_HEAD || n->parent->args == NULL) return; - switch(n->parent->args->argv[0].arg) { - case MDOC_Diag: - n->norm->Bl.type = LIST_diag; - break; - case MDOC_Column: - n->norm->Bl.type = LIST_column; - break; - default: - break; + args = n->parent->args; + for (i = 0; i < args->argc; i++) { + switch(args->argv[i].arg) { + case MDOC_Diag: + n->norm->Bl.type = LIST_diag; + return; + case MDOC_Column: + n->norm->Bl.type = LIST_column; + return; + default: + break; + } } } -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv