mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-26 11:18:55 -06:00
bugfix in pgf_tabular_linearize
This commit is contained in:
@@ -2206,8 +2206,11 @@ PgfText **pgf_tabular_linearize(PgfDB *db, PgfConcrRevision revision,
|
|||||||
linearizer.reverse_and_label(false);
|
linearizer.reverse_and_label(false);
|
||||||
if (linearizer.resolve()) {
|
if (linearizer.resolve()) {
|
||||||
ref<PgfConcrLincat> lincat = linearizer.get_lincat();
|
ref<PgfConcrLincat> lincat = linearizer.get_lincat();
|
||||||
|
if (lincat != 0) {
|
||||||
PgfText **res = (PgfText **)
|
PgfText **res = (PgfText **)
|
||||||
malloc((lincat->fields->len+1)*2*sizeof(PgfText*));
|
malloc((lincat->fields->len+1)*2*sizeof(PgfText*));
|
||||||
|
if (res == NULL)
|
||||||
|
throw pgf_systemerror(ENOMEM);
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
for (size_t i = 0; i < lincat->fields->len; i++) {
|
for (size_t i = 0; i < lincat->fields->len; i++) {
|
||||||
linearizer.linearize(&out, i);
|
linearizer.linearize(&out, i);
|
||||||
@@ -2222,6 +2225,7 @@ PgfText **pgf_tabular_linearize(PgfDB *db, PgfConcrRevision revision,
|
|||||||
res[pos++] = NULL;
|
res[pos++] = NULL;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} PGF_API_END
|
} PGF_API_END
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user