summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/ast/ast_module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/ast/ast_module.cpp')
-rw-r--r--TAO/TAO_IDL/ast/ast_module.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp
index d6e4793476f..4338d86c69a 100644
--- a/TAO/TAO_IDL/ast/ast_module.cpp
+++ b/TAO/TAO_IDL/ast/ast_module.cpp
@@ -170,12 +170,21 @@ AST_Module::fe_add_module (AST_Module *t)
AST_Module *m = 0;
UTL_Scope *scope = t->defined_in ();
+ const char *prefix_holder = 0;
// If our prefix is empty, we check to see if an ancestor has one.
while (ACE_OS::strcmp (t->prefix (), "") == 0 && scope != 0)
{
AST_Decl *parent = ScopeAsDecl (scope);
- t->prefix (ACE_const_cast (char *, parent->prefix ()));
+ prefix_holder = parent->prefix ();
+
+ // We have reached global scope.
+ if (prefix_holder == 0)
+ {
+ break;
+ }
+
+ t->prefix (ACE_const_cast (char *, prefix_holder));
scope = parent->defined_in ();
}