From ba3dde4254f0ae8394b4ebaf2a13b0ef65d62f55 Mon Sep 17 00:00:00 2001 From: parsons Date: Mon, 17 Mar 2003 16:01:16 +0000 Subject: ChangeLogTag: Mon Mar 17 09:51:36 2003 Jeff Parsons --- TAO/ChangeLog | 14 ++++++++++++++ TAO/TAO_IDL/ast/ast_module.cpp | 11 ++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index fc663a8fc6b..1c070470b2c 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,17 @@ +Mon Mar 17 09:51:36 2003 Jeff Parsons + + * TAO_IDL/ast/ast_module.cpp (fe_add_module): + + Added a check for a 0 prefix (as opposed to one that is + an empty string) before doing a string compare. As a result + of the change in the entry below, it became possible for + this to happen when checking for previous openings of a + module, in order to pass along any prefix that may have + been applied to the previous opening. If a prefix of 0 + is found, this now indicates that we are looking at the + global scope, and can break out of the checking loop + immediately. + Fri Mar 14 21:50:10 2003 Jeff Parsons * TAO_IDL/util/utl_global.cpp: 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 (); } -- cgit v1.2.1