summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-04 10:24:39 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-04 10:24:39 (GMT)
commit1ade82e135d4e815db5b33c9ebd67632b74e5e1d (patch)
treeeafda5b3e4062922ee4f0b64e8f90695bfbde9c3 /plugins/pychrysalide/analysis
parent8dc83465a6ca2d5b94b983b39f6c06d37e4126a0 (diff)
Fixed various mistakes in Itanium C++ demangling.
Diffstat (limited to 'plugins/pychrysalide/analysis')
-rw-r--r--plugins/pychrysalide/analysis/types/array.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/pychrysalide/analysis/types/array.c b/plugins/pychrysalide/analysis/types/array.c
index d021e16..6f70b02 100644
--- a/plugins/pychrysalide/analysis/types/array.c
+++ b/plugins/pychrysalide/analysis/types/array.c
@@ -281,7 +281,14 @@ static PyObject *py_array_type_get_dimension_expression(PyObject *self, void *cl
dim = g_array_type_get_dimension_expression(type);
- result = PyUnicode_FromString(dim);
+ if (dim != NULL)
+ result = PyUnicode_FromString(dim);
+
+ else
+ {
+ result = Py_None;
+ Py_INCREF(result);
+ }
return result;
@@ -306,15 +313,19 @@ static int py_array_type_set_dimension_expression(PyObject *self, PyObject *valu
{
GArrayType *type; /* Version GLib du type */
- if (!PyUnicode_Check(value))
+ if (!PyUnicode_Check(value) && value != Py_None)
{
- PyErr_SetString(PyExc_TypeError, _("The attribute value must be a string."));
+ PyErr_SetString(PyExc_TypeError, _("The attribute value must be a string or None."));
return -1;
}
type = G_ARRAY_TYPE(pygobject_get(self));
- g_array_type_set_dimension_expression(type, strdup(PyUnicode_DATA(value)));
+ if (value == Py_None)
+ g_array_type_set_empty_dimension(type);
+
+ else
+ g_array_type_set_dimension_expression(type, strdup(PyUnicode_DATA(value)));
return 0;