From: Ben Pfaff Date: Mon, 26 Nov 2018 00:56:02 +0000 (-0800) Subject: ascii: Fix assertion in ascii_output_table_item(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8297b870c691e213d87c43f892bd2a24bb64ec2;p=pspp ascii: Fix assertion in ascii_output_table_item(). The previous assertion did not actually detect the bug it was intended to cover. --- diff --git a/src/output/ascii.c b/src/output/ascii.c index db75e69630..897182d043 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -463,7 +463,12 @@ ascii_output_table_item (struct ascii_driver *a, used = render_pager_draw_next (p, a->length - a->y); if (used == 0) { - assert (a->y >= 0); + /* Make sure that we're not in a loop where the table we're rendering + can't be broken to fit on a page. (The check on + render_pager_has_next() allows for objects that turn out to be + empty when we try to render them.) */ + assert (a->y > 0 || !render_pager_has_next (p)); + ascii_close_page (a); if (!ascii_open_page (a)) break;