summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-17 21:22:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-17 21:22:28 (GMT)
commit7efc82d0b78389638fd1b9fac7203f8aad13b53c (patch)
treeb3e364cafa62400d8b03f8265841ed5c70d32e6c /src
parentacac24dbaae205b389c81132939280295b6a5d34 (diff)
Included the namespace when building routine labels.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/routine.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c
index cc1e337..f227cba 100644
--- a/src/analysis/routine.c
+++ b/src/analysis/routine.c
@@ -259,6 +259,8 @@ void g_binary_routine_set_namespace(GBinRoutine *routine, GDataType *namespace,
if (routine->ns_sep != NULL)
free(routine->ns_sep);
+ assert((namespace == NULL && sep == NULL) || (namespace != NULL && sep != NULL));
+
routine->namespace = namespace;
routine->ns_sep = sep;
@@ -555,12 +557,33 @@ void g_binary_routine_remove_arg(GBinRoutine *routine, size_t index)
static char *g_binary_routine_get_label(const GBinRoutine *routine)
{
char *result; /* Etiquette à renvoyer */
+ char *tmp; /* Construction temporaire */
+
+ result = NULL;
+
+ if (routine->namespace != NULL)
+ {
+ tmp = g_data_type_to_string(routine->namespace, true);
+
+ result = stradd(result, tmp);
+ result = stradd(result, routine->ns_sep);
+
+ free(tmp);
+
+ }
if (routine->full_name != NULL)
- result = g_data_type_to_string(routine->full_name, true);
+ {
+ tmp = g_data_type_to_string(routine->full_name, true);
- else
- result = strdup(routine->name != NULL ? routine->name : "");
+ result = stradd(result, tmp);
+
+ free(tmp);
+
+ }
+
+ else if (routine->name != NULL)
+ result = stradd(result, routine->name);
return result;