fix: mangle function name only when parent module is available
This commit is contained in:
parent
a8bceff951
commit
26bc5a796a
|
@ -2698,13 +2698,15 @@ int createFunction(Function* function, AST_NODE_PTR currentNode) {
|
||||||
|
|
||||||
// compose function name by appending parent modules
|
// compose function name by appending parent modules
|
||||||
char* modules = module_ref_to_str(currentNode->location.module_ref);
|
char* modules = module_ref_to_str(currentNode->location.module_ref);
|
||||||
char* composed_name =
|
if (strlen(modules) > 0) {
|
||||||
g_strjoin("", modules, "::", function->name, NULL);
|
char* composed_name =
|
||||||
char* cached_composed_name =
|
g_strjoin("", modules, "::", function->name, NULL);
|
||||||
mem_strdup(MemoryNamespaceSet, composed_name);
|
char* cached_composed_name =
|
||||||
|
mem_strdup(MemoryNamespaceSet, composed_name);
|
||||||
|
|
||||||
g_free(composed_name);
|
g_free(composed_name);
|
||||||
function->name = cached_composed_name;
|
function->name = cached_composed_name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mem_free(functionParameter);
|
mem_free(functionParameter);
|
||||||
|
|
Loading…
Reference in New Issue