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