summaryrefslogtreecommitdiff
path: root/src
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 /src
parent8dc83465a6ca2d5b94b983b39f6c06d37e4126a0 (diff)
Fixed various mistakes in Itanium C++ demangling.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/types/array.c33
-rw-r--r--src/analysis/types/array.h3
2 files changed, 33 insertions, 3 deletions
diff --git a/src/analysis/types/array.c b/src/analysis/types/array.c
index 714ab58..5aea07b 100644
--- a/src/analysis/types/array.c
+++ b/src/analysis/types/array.c
@@ -230,6 +230,9 @@ static GDataType *g_array_type_dup(const GArrayType *type)
else if (type->dim_expr != NULL)
g_array_type_set_dimension_expression(G_ARRAY_TYPE(result), strdup(type->dim_expr));
+ else
+ g_array_type_set_empty_dimension(G_ARRAY_TYPE(result));
+
return result;
}
@@ -268,7 +271,7 @@ static char *g_array_type_to_string(const GArrayType *type, bool include)
}
}
- else
+ else if (type->dim_expr != NULL)
result = stradd(result, type->dim_expr);
result = stradd(result, "]");
@@ -356,7 +359,7 @@ ssize_t g_array_type_get_dimension_number(const GArrayType *type)
/******************************************************************************
* *
-* Paramètres : type = type à consulter. *
+* Paramètres : type = type à traiter. *
* dim = dimension positive ou nulle. *
* *
* Description : Définit la dimension associée au tableau. *
@@ -406,7 +409,7 @@ const char *g_array_type_get_dimension_expression(const GArrayType *type)
/******************************************************************************
* *
-* Paramètres : type = type à consulter. *
+* Paramètres : type = type à traiter. *
* expr = expression de dimension. *
* *
* Description : Définit la dimension associée au tableau. *
@@ -427,3 +430,27 @@ void g_array_type_set_dimension_expression(GArrayType *type, char *expr)
type->dim_expr = expr;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : type = type à traiter. *
+* *
+* Description : Définit une dimension vide pour le tableau. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_array_type_set_empty_dimension(GArrayType *type)
+{
+ if (!type->numbered && type->dim_expr != NULL)
+ free(type->dim_expr);
+
+ type->numbered = false;
+
+ type->dim_expr = NULL;
+
+}
diff --git a/src/analysis/types/array.h b/src/analysis/types/array.h
index d432c22..3bec2a0 100644
--- a/src/analysis/types/array.h
+++ b/src/analysis/types/array.h
@@ -71,6 +71,9 @@ const char *g_array_type_get_dimension_expression(const GArrayType *);
/* Définit la dimension associée au tableau. */
void g_array_type_set_dimension_expression(GArrayType *, char *);
+/* Définit une dimension vide pour le tableau. */
+void g_array_type_set_empty_dimension(GArrayType *);
+
#endif /* _ANALYSIS_TYPES_ARRAY_H */