mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
Declare context differently in Transaction_createCategory
This is an attempt to try fix the segfaults in CI which I cannot reproduce locally
This commit is contained in:
@@ -91,7 +91,7 @@ Transaction_dropFunction(TransactionObject *self, PyObject *args)
|
|||||||
fname->size = size;
|
fname->size = size;
|
||||||
|
|
||||||
PgfExn err;
|
PgfExn err;
|
||||||
pgf_drop_category(self->pgf->db, self->revision, fname, &err);
|
pgf_drop_function(self->pgf->db, self->revision, fname, &err);
|
||||||
PyMem_Free(fname);
|
PyMem_Free(fname);
|
||||||
if (handleError(err) != PGF_EXN_NONE) {
|
if (handleError(err) != PGF_EXN_NONE) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -115,8 +115,8 @@ Transaction_createCategory(TransactionObject *self, PyObject *args)
|
|||||||
catname->size = size;
|
catname->size = size;
|
||||||
|
|
||||||
Py_ssize_t n_hypos = PyList_Size(hypos);
|
Py_ssize_t n_hypos = PyList_Size(hypos);
|
||||||
PgfTypeHypo context[n_hypos];
|
// PgfTypeHypo context[n_hypos];
|
||||||
// PgfTypeHypo *context = alloca(sizeof(PgfTypeHypo)*n_hypos);
|
PgfTypeHypo *context = alloca(sizeof(PgfTypeHypo)*n_hypos);
|
||||||
for (Py_ssize_t i = 0; i < n_hypos; i++) {
|
for (Py_ssize_t i = 0; i < n_hypos; i++) {
|
||||||
PyObject *hytup = (PyObject *)PyList_GetItem(hypos, i);
|
PyObject *hytup = (PyObject *)PyList_GetItem(hypos, i);
|
||||||
context[i].bind_type = PyLong_AsLong(PyTuple_GetItem(hytup, 0));
|
context[i].bind_type = PyLong_AsLong(PyTuple_GetItem(hytup, 0));
|
||||||
@@ -148,7 +148,7 @@ Transaction_dropCategory(TransactionObject *self, PyObject *args)
|
|||||||
catname->size = size;
|
catname->size = size;
|
||||||
|
|
||||||
PgfExn err;
|
PgfExn err;
|
||||||
pgf_drop_function(self->pgf->db, self->revision, catname, &err);
|
pgf_drop_category(self->pgf->db, self->revision, catname, &err);
|
||||||
PyMem_Free(catname);
|
PyMem_Free(catname);
|
||||||
if (handleError(err) != PGF_EXN_NONE) {
|
if (handleError(err) != PGF_EXN_NONE) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user