mdoc_valid_post() may indirectly call roff_node_unlink() which may
authorschwarze <schwarze@openbsd.org>
Fri, 1 May 2015 16:56:36 +0000 (16:56 +0000)
committerschwarze <schwarze@openbsd.org>
Fri, 1 May 2015 16:56:36 +0000 (16:56 +0000)
commitb57aad23faa6782ab380ed7344d3397db11dd21e
tree6b7f3e11464cab759eb016bbfe1c7244c116e7f9
parent4abbcaf85b29885eb2b92243d27f3a8b2518dabc
mdoc_valid_post() may indirectly call roff_node_unlink() which may
set ROFF_NEXT_CHILD, which is desirable for the final call to
mdoc_valid_post() - in case the target itself gets deleted, the
parse point may need this adjustment - but not for the intermediate
calls - if intermediate nodes get deleted, that mustn't clobber the
parse point.  So move setting ROFF_NEXT_SIBLING to the proper place
in rew_last().

This fixes the assertion failure in jsg@'s afl test case 108/Apr27.
usr.bin/mandoc/mdoc_macro.c