Fix wrong namespaces when using XML imports

This commit is contained in:
roblabla 2024-08-15 14:36:07 +02:00
parent 68cad06ddf
commit f0ec22e9b0

View File

@ -197,7 +197,7 @@ class SymbolTableXmlMgr {
String addrStr = element.getAttribute("ADDRESS");
String namespace = element.getAttribute("NAMESPACE");
if (namespace != null && namespace.endsWith("::")) {
namespace = namespace.substring(namespace.length() - 2);
namespace = namespace.substring(0, namespace.length() - 2);
}
String primary = element.getAttribute("PRIMARY");
String sourceTypeString = element.getAttribute("SOURCE_TYPE");
@ -233,13 +233,8 @@ class SymbolTableXmlMgr {
scope = localNamespace;
}
else if (namespace != null && namespace.length() != 0) {
if (program.getGlobalNamespace().equals(localNamespace)) {
scope = NamespaceUtils.createNamespaceHierarchy(namespace,
program.getGlobalNamespace(), program, sourceType);
}
else {
name = namespace + name;
}
scope = NamespaceUtils.createNamespaceHierarchy(namespace,
program.getGlobalNamespace(), program, sourceType);
}
Symbol s = symbolTable.getPrimarySymbol(addr);