diff options
author | 2015-02-12 12:24:33 +0000 | |
---|---|---|
committer | 2015-02-12 12:24:33 +0000 | |
commit | e89dd22a4fc303f8cdf4180c4fb9655a45e8e724 (patch) | |
tree | 555addff5e528e9a957bfbbad3ddc582a60eec97 /compat_strtonum.c | |
parent | 69f54c346ec87b3899a95b224628d8df313bbc85 (diff) | |
download | mandoc-e89dd22a4fc303f8cdf4180c4fb9655a45e8e724.tar.gz mandoc-e89dd22a4fc303f8cdf4180c4fb9655a45e8e724.tar.zst mandoc-e89dd22a4fc303f8cdf4180c4fb9655a45e8e724.zip |
Delete the mdoc_node.pending pointer and the function calculating
it, make_pending(), which was the most difficult function of the
whole mdoc(7) parser. After almost five years of maintaining this
hellhole, i just noticed the pointer isn't needed after all.
Blocks are always rewound in the reverse order they were opened;
that even holds for broken blocks. Consequently, it is sufficient
to just mark broken blogs with the flag MDOC_BROKEN and breaking
blocks with the flag MDOC_ENDED. When rewinding, instead of iterating
the pending pointers, just iterate from each broken block to its
parents, rewinding all that are MDOC_ENDED and stopping after
processing the first ancestor that it not MDOC_BROKEN. For ENDBODY
markers, use the mdoc_node.body pointer in place of the former
mdoc_node.pending.
This also fixes an assertion failure found by jsg@ with afl,
test case #467 (Bo Bl It Bd Bc It), where (surprise surprise)
the pending pointer got corrupted.
Improved functionality, minus one function, minus one struct field,
minus 50 lines of code.
Diffstat (limited to 'compat_strtonum.c')
0 files changed, 0 insertions, 0 deletions