summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;