mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
a bugfix which was causing an infinite loop in the C linearizer for some sentences
This commit is contained in:
@@ -408,6 +408,11 @@ pgf_cnc_tree_enum_next(GuEnum* self, void* to, GuPool* pool)
|
|||||||
PgfLzn* lzn = gu_container(self, PgfLzn, en);
|
PgfLzn* lzn = gu_container(self, PgfLzn, en);
|
||||||
PgfCncTree* toc = to;
|
PgfCncTree* toc = to;
|
||||||
|
|
||||||
|
if (lzn->ch == NULL) {
|
||||||
|
*toc = gu_null_variant;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GuChoiceMark mark = gu_choice_mark(lzn->ch);
|
GuChoiceMark mark = gu_choice_mark(lzn->ch);
|
||||||
*toc = pgf_lzn_resolve(lzn, lzn->expr, NULL, pool);
|
*toc = pgf_lzn_resolve(lzn, lzn->expr, NULL, pool);
|
||||||
gu_choice_reset(lzn->ch, mark);
|
gu_choice_reset(lzn->ch, mark);
|
||||||
@@ -426,7 +431,9 @@ pgf_cnc_tree_enum_next(GuEnum* self, void* to, GuPool* pool)
|
|||||||
gu_pool_free(tmp_pool);
|
gu_pool_free(tmp_pool);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gu_choice_advance(lzn->ch);
|
if (!gu_choice_advance(lzn->ch)) {
|
||||||
|
lzn->ch = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfCncTreeEnum*
|
PgfCncTreeEnum*
|
||||||
|
|||||||
Reference in New Issue
Block a user