summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-01-15 20:32:28 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-01-15 20:32:28 +0000
commitf12e80a08f04f6b9630097a958fe9c4041d506c3 (patch)
treea1aa516f8b2803929bf1fe4ad4d92679ffb2d677
parent5254dcc119f1b055e538fda38069e0eae2c6d2e9 (diff)
downloadATCD-f12e80a08f04f6b9630097a958fe9c4041d506c3.tar.gz
ChangeLogTag: Fri Jan 15 20:31:51 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--modules/TAO/ChangeLog21
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_context.cpp24
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_reifying.cpp41
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_tmpl_module_inst.cpp202
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_visitor_context.h7
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_visitor_reifying.h5
-rw-r--r--modules/TAO/TAO_IDL/include/idl_global.h2
-rw-r--r--modules/TAO/TAO_IDL/util/utl_global.cpp20
-rw-r--r--modules/TAO/TAO_IDL/util/utl_scope.cpp2
9 files changed, 158 insertions, 166 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog
index a082abcf467..2ee70e4faa3 100644
--- a/modules/TAO/ChangeLog
+++ b/modules/TAO/ChangeLog
@@ -1,3 +1,24 @@
+Fri Jan 15 20:31:51 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/include/idl_global.h:
+ * TAO_IDL/be/be_visitor_tmpl_module_inst.cpp:
+ * TAO_IDL/be/be_visitor_context.cpp:
+ * TAO_IDL/be/be_visitor_reifying.cpp:
+ * TAO_IDL/be_include/be_visitor_context.h:
+ * TAO_IDL/be_include/be_visitor_reifying.h:
+ * TAO_IDL/util/utl_global.cpp:
+ * TAO_IDL/util/utl_scope.cpp:
+
+ - Removed the template module instantation
+ scope storage in the visitor context, using
+ instead the global scope stack for that
+ purpose.
+
+ - Modified reifying visitor to find and store
+ a node already created in a template module
+ instantiation, if the corresponding node is
+ referenced in the template module.
+
Fri Jan 15 15:31:56 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp:
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_context.cpp b/modules/TAO/TAO_IDL/be/be_visitor_context.cpp
index 3d4d682ec6e..476c62780d4 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_context.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_context.cpp
@@ -55,8 +55,7 @@ be_visitor_context::be_visitor_context (void)
comma_ (0),
interface_ (0),
template_params_ (0),
- template_args_ (0),
- template_module_inst_scope_ (0)
+ template_args_ (0)
{
}
@@ -71,7 +70,9 @@ be_visitor_context::be_visitor_context (const be_visitor_context &ctx)
attr_ (ctx.attr_),
exception_ (ctx.exception_),
comma_ (ctx.comma_),
- interface_ (ctx.interface_)
+ interface_ (ctx.interface_),
+ template_params_ (ctx.template_params_),
+ template_args_ (ctx.template_args_)
{
}
@@ -89,6 +90,8 @@ be_visitor_context::operator= (const be_visitor_context &ctx)
this->exception_ = ctx.exception_;
this->comma_ = ctx.comma_;
this->interface_ = ctx.interface_;
+ this->template_args_ = ctx.template_args_;
+ this->template_params_ = ctx.template_params_;
return *this;
}
@@ -114,6 +117,8 @@ be_visitor_context::reset (void)
this->exception_ = 0;
this->comma_ = 0;
this->interface_ = 0;
+ this->template_args_ = 0;
+ this->template_params_ = 0;
}
void
@@ -272,19 +277,6 @@ be_visitor_context::template_args (FE_Utils::T_ARGLIST *args)
this->template_args_ = args;
}
-be_scope *
-be_visitor_context::template_module_inst_scope (void) const
-{
- return this->template_module_inst_scope_;
-}
-
-void
-be_visitor_context::template_module_inst_scope (UTL_Scope *s)
-{
- this->template_module_inst_scope_ =
- be_scope::narrow_from_scope (s);
-}
-
// ****************************************************************
be_argument *
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_reifying.cpp b/modules/TAO/TAO_IDL/be/be_visitor_reifying.cpp
index e72bbfc251d..e0ef03118da 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_reifying.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_reifying.cpp
@@ -49,7 +49,23 @@ be_visitor_reifying::reified_node (void) const
int
be_visitor_reifying::visit_interface (be_interface *node)
{
- this->reified_node_ = node;
+ UTL_ScopedName *tmpl_tail =
+ this->template_module_rel_name (node);
+
+ if (tmpl_tail != 0)
+ {
+ AST_Decl *d =
+ idl_global->scopes ().top ()->lookup_by_name (
+ tmpl_tail,
+ true);
+
+ this->reified_node_ = d;
+ }
+ else
+ {
+ this->reified_node_ = node;
+ }
+
return 0;
}
@@ -170,6 +186,10 @@ be_visitor_reifying::visit_array (be_array *node)
false),
-1);
+
+ // No need to add this new node to any scope - it's anonymous
+ // and owned by the node that references it.
+
sn.destroy ();
v_list->destroy ();
delete v_list;
@@ -236,6 +256,10 @@ be_visitor_reifying::visit_sequence (be_sequence *node)
false,
false),
-1);
+
+ // No need to add this new node to any scope - it's anonymous
+ // and owned by the node that references it.
+
return 0;
}
@@ -312,20 +336,27 @@ be_visitor_reifying::visit_param_holder (be_param_holder *node)
-1);
}
-bool
-be_visitor_reifying::declared_in_template_module (AST_Decl *d)
+UTL_ScopedName *
+be_visitor_reifying::template_module_rel_name (AST_Decl *d)
{
AST_Decl *tmp = d;
+ ACE_CString name (d->full_name ());
while (tmp != 0)
{
if (AST_Template_Module::narrow_from_decl (tmp) != 0)
{
- return true;
+ ACE_CString head (tmp->local_name ()->get_string ());
+
+ ACE_CString::size_type start = name.find (head) + 2;
+
+ ACE_CString tail (name.substr (start + head.length ()));
+
+ return idl_global->string_to_scoped_name (tail.c_str ());
}
tmp = ScopeAsDecl (tmp->defined_in ());
}
- return false;
+ return 0;
} \ No newline at end of file
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_tmpl_module_inst.cpp b/modules/TAO/TAO_IDL/be/be_visitor_tmpl_module_inst.cpp
index bf88d9a378f..dfebb931aa1 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_tmpl_module_inst.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_tmpl_module_inst.cpp
@@ -36,6 +36,8 @@
#include "fe_interface_header.h"
#include "fe_obv_header.h"
+#include "nr_extern.h"
+
be_visitor_tmpl_module_inst::be_visitor_tmpl_module_inst (
be_visitor_context *ctx)
: be_visitor_scope (ctx),
@@ -50,6 +52,10 @@ be_visitor_tmpl_module_inst::~be_visitor_tmpl_module_inst (void)
int
be_visitor_tmpl_module_inst::visit_root (be_root *node)
{
+ // We will be updating the global scope stack as required for
+ // correct implied IDL creation. The root node is already on
+ // the stack so we needn't do anything here.
+
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -65,26 +71,34 @@ be_visitor_tmpl_module_inst::visit_root (be_root *node)
int
be_visitor_tmpl_module_inst::visit_module (be_module *node)
{
- UTL_Scope *s = this->ctx_->template_module_inst_scope ();
-
// We can conveniently check this member's value to tell
// if we are (at some level )processing a template module
// instantiation.
// If so, we need to create a new module on the AST.
// When processing of the instantiation is done, the member
// is reset to 0.
- if (this->ctx_->template_args () != 0)
- {
- be_module *m = 0;
+ bool in_template_module =
+ this->ctx_->template_args () != 0;
+
+ be_module *added_module = 0;
- ACE_NEW_RETURN (m,
+ // If we are traversing a template module as a result of its
+ // instantiation, we want to create a corresponding module
+ // in the instantiated module (at the top of the scope stack),
+ // and push it on the scope stack. Otherwise, we just push
+ // the module we are visiting.
+ if (in_template_module)
+ {
+ ACE_NEW_RETURN (added_module,
be_module (node->name ()),
-1);
- s->add_to_scope (m);
- this->ctx_->template_module_inst_scope (m);
+ idl_global->scopes ().top ()->add_to_scope (added_module);
}
+ idl_global->scopes ().push (
+ in_template_module ? added_module : node);
+
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -94,8 +108,8 @@ be_visitor_tmpl_module_inst::visit_module (be_module *node)
-1);
}
- // Restore the outer adding scope.
- this->ctx_->template_module_inst_scope (s);
+ // Restore scope stack.
+ idl_global->scopes ().pop ();
return 0;
}
@@ -125,21 +139,18 @@ be_visitor_tmpl_module_inst::visit_template_module_inst (
be_template_module_inst *node)
{
this->ctx_->template_args (node->template_args ());
- UTL_Scope *s = node->defined_in ();
be_module *instance = 0;
-
ACE_NEW_RETURN (instance,
be_module (node->name ()),
-1);
// Add the new module to the scope containing the template
// module instantiation.
- s->add_to_scope (instance);
+ idl_global->scopes ().top ()->add_to_scope (instance);
- // Everything we visit in the template module below will be
- // added to the module just created.
- this->ctx_->template_module_inst_scope (instance);
+ // Update our scope management.
+ idl_global->scopes ().push (instance);
be_template_module *tm =
be_template_module::narrow_from_decl (node->ref ());
@@ -160,8 +171,8 @@ be_visitor_tmpl_module_inst::visit_template_module_inst (
// visit its scope.
this->ctx_->template_args (0);
- // Restore the outer adding scope.
- this->ctx_->template_module_inst_scope (s);
+ // Restore the scope stack.
+ idl_global->scopes ().pop ();
return 0;
}
@@ -189,10 +200,6 @@ be_visitor_tmpl_module_inst::visit_valuetype (be_valuetype *node)
this->create_name_list (node->supports (),
node->n_supports ());
- // Set the scope to our adding scope.
- UTL_Scope *s = this->ctx_->template_module_inst_scope ();
- idl_global->scopes ().push (s);
-
Identifier *node_id = 0;
ACE_NEW_RETURN (node_id,
Identifier (node->local_name ()),
@@ -256,34 +263,10 @@ be_visitor_tmpl_module_inst::visit_valuetype (be_valuetype *node)
delete supports_names;
supports_names = 0;
- // Back to reality.
- idl_global->scopes ().pop ();
-
- added_vtype->set_defined_in (s);
- added_vtype->set_imported (node->imported ());
-
- // Set repo id to 0, so it will be recomputed on the next access,
- // and set the prefix to the eventtype's prefix. All this is
- // necessary in case the eventtype's prefix was modified after
- // its declaration. We assume 'implied IDL' means that the
- // derived event consumer interface should have the same prefix.
- added_vtype->AST_Decl::repoID (0);
- added_vtype->prefix (const_cast<char*> (node->prefix ()));
-
- // Force calculation of the repo id.
- const char *dummy = added_vtype->repoID ();
-
- // For interfaces, this should always be a module or root, and
- // AST_Root is a subclass of AST_Module.
- AST_Module *m = AST_Module::narrow_from_scope (s);
-
- m->be_add_valuetype (added_vtype);
-
- // Save our containing scope for restoration later.
- be_scope *holder = this->ctx_->template_module_inst_scope ();
+ idl_global->scopes ().top ()->add_to_scope (added_vtype);
- // Update the adding scope for the interface contents.
- this->ctx_->template_module_inst_scope (added_vtype);
+ // Update the scope management.
+ idl_global->scopes ().push (added_vtype);
if (this->visit_scope (node) != 0)
{
@@ -294,8 +277,8 @@ be_visitor_tmpl_module_inst::visit_valuetype (be_valuetype *node)
-1);
}
- // Restore the previous scope.
- this->ctx_->template_module_inst_scope (holder);
+ // Through with this scope.
+ idl_global->scopes ().pop ();
// Reset the flag.
this->for_eventtype_ = false;
@@ -315,10 +298,6 @@ be_visitor_tmpl_module_inst::visit_interface (be_interface *node)
this->create_name_list (node->inherits (),
node->n_inherits ());
- // Set the scope to our adding scope.
- UTL_Scope *s = this->ctx_->template_module_inst_scope ();
- idl_global->scopes ().push (s);
-
Identifier *node_id = 0;
ACE_NEW_RETURN (node_id,
Identifier (node->local_name ()),
@@ -350,34 +329,10 @@ be_visitor_tmpl_module_inst::visit_interface (be_interface *node)
delete parent_names;
parent_names = 0;
- // Back to reality.
- idl_global->scopes ().pop ();
-
- added_iface->set_defined_in (s);
- added_iface->set_imported (node->imported ());
-
- // Set repo id to 0, so it will be recomputed on the next access,
- // and set the prefix to the eventtype's prefix. All this is
- // necessary in case the eventtype's prefix was modified after
- // its declaration. We assume 'implied IDL' means that the
- // derived event consumer interface should have the same prefix.
- added_iface->AST_Decl::repoID (0);
- added_iface->prefix (const_cast<char*> (node->prefix ()));
-
- // Force calculation of the repo id.
- const char *dummy = added_iface->repoID ();
-
- // For interfaces, this should always be a module or root, and
- // AST_Root is a subclass of AST_Module.
- AST_Module *m = AST_Module::narrow_from_scope (s);
-
- m->be_add_interface (added_iface);
-
- // Save our containing scope for restoration later.
- be_scope *holder = this->ctx_->template_module_inst_scope ();
+ idl_global->scopes ().top ()->add_to_scope (added_iface);
- // Update the adding scope for the interface contents.
- this->ctx_->template_module_inst_scope (added_iface);
+ // Update the scope stack.
+ idl_global->scopes ().push (added_iface);
if (this->visit_scope (node) != 0)
{
@@ -388,8 +343,8 @@ be_visitor_tmpl_module_inst::visit_interface (be_interface *node)
-1);
}
- // Restore the previous scope.
- this->ctx_->template_module_inst_scope (holder);
+ // Through with this scope.
+ idl_global->scopes ().pop ();
return 0;
}
@@ -410,13 +365,7 @@ be_visitor_tmpl_module_inst::visit_attribute (be_attribute *node)
node->is_abstract ()),
-1);
- be_scope *s = this->ctx_->template_module_inst_scope ();
- added_attr->set_defined_in (s);
- s->add_to_scope (added_attr);
-
- // Force recalculation of our repo ID based on the new scope.
- added_attr->repoID (0);
- const char *dummy = added_attr->repoID ();
+ idl_global->scopes ().top ()->add_to_scope (added_attr);
// These will work even if the exception lists are null.
@@ -450,11 +399,10 @@ be_visitor_tmpl_module_inst::visit_operation (be_operation *node)
node->is_abstract ()),
-1);
- be_scope *s = this->ctx_->template_module_inst_scope ();
- s->add_to_scope (added_op);
- added_op->set_defined_in (s);
+ idl_global->scopes ().top ()->add_to_scope (added_op);
- this->ctx_->template_module_inst_scope (added_op);
+ // Update the scope stack.
+ idl_global->scopes ().push (added_op);
if (this->visit_scope (node) != 0)
{
@@ -465,7 +413,8 @@ be_visitor_tmpl_module_inst::visit_operation (be_operation *node)
-1);
}
- this->ctx_->template_module_inst_scope (s);
+ // Through with this scope.
+ idl_global->scopes ().pop ();
UTL_ExceptList *new_ex =
this->reify_exception_list (node->exceptions ());
@@ -482,16 +431,14 @@ be_visitor_tmpl_module_inst::visit_argument (be_argument *node)
AST_Type::narrow_from_decl (
this->reify_type (node->field_type ()));
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
+ be_argument *added_arg = 0;
+ ACE_NEW_RETURN (added_arg,
be_argument (node->direction (),
t,
node->name ()),
-1);
- // This method is virtual in be_scope and overridden in
- // be_operation and be_factory.
- this->ctx_->template_module_inst_scope ()->be_add_argument (arg);
+ idl_global->scopes ().top ()->add_to_scope (added_arg);
return 0;
}
@@ -516,9 +463,7 @@ be_visitor_tmpl_module_inst::visit_typedef (be_typedef *node)
false),
-1);
- be_scope *s = this->ctx_->template_module_inst_scope ();
- added_td->set_defined_in (s);
- s->add_to_scope (added_td);
+ idl_global->scopes ().top ()->add_to_scope (added_td);
return 0;
}
@@ -574,9 +519,7 @@ be_visitor_tmpl_module_inst::visit_constant (be_constant *node)
be_constant (et, new_v, node->name ()),
-1);
- be_scope *s = this->ctx_->template_module_inst_scope ();
- added_const->set_defined_in (s);
- s->add_to_scope (added_const);
+ idl_global->scopes ().top ()->add_to_scope (added_const);
return 0;
}
@@ -589,22 +532,19 @@ be_visitor_tmpl_module_inst::visit_structure (be_structure *node)
return 0;
}
+ UTL_ScopedName sn (node->name ()->last_component (), 0);
+
be_structure *added_struct = 0;
ACE_NEW_RETURN (added_struct,
- be_structure (node->name (),
+ be_structure (&sn,
node->is_local (),
node->is_abstract ()),
-1);
-
- // Hold current scope for restoration later.
- be_scope *holder = this->ctx_->template_module_inst_scope ();
-
- holder->add_to_scope (added_struct);
- added_struct->set_defined_in (holder);
-
+
+ idl_global->scopes ().top ()->add_to_scope (added_struct);
- // Store the new scope for traversal.
- this->ctx_->template_module_inst_scope (added_struct);
+ // Update our scope stack.
+ idl_global->scopes ().push (added_struct);
if (this->visit_scope (node) != 0)
{
@@ -615,8 +555,8 @@ be_visitor_tmpl_module_inst::visit_structure (be_structure *node)
-1);
}
- // Restore the outer scope.
- this->ctx_->template_module_inst_scope (holder);
+ // Through with this scope.
+ idl_global->scopes ().pop ();
return 0;
}
@@ -628,16 +568,14 @@ be_visitor_tmpl_module_inst::visit_field (be_field *node)
AST_Type::narrow_from_decl (
this->reify_type (node->field_type ()));
- be_field *f = 0;
- ACE_NEW_RETURN (f,
+ be_field *added_field = 0;
+ ACE_NEW_RETURN (added_field,
be_field (t,
node->name (),
node->visibility ()),
-1);
- be_scope *s = this->ctx_->template_module_inst_scope ();
- s->be_add_field (f);
- f->set_defined_in (s);
+ idl_global->scopes ().top ()->add_to_scope (added_field);
return 0;
}
@@ -648,16 +586,15 @@ be_visitor_tmpl_module_inst::visit_factory (be_factory *node)
Identifier id (node->local_name ()->get_string ());
UTL_ScopedName sn (&id, 0);
- be_factory *f = 0;
- ACE_NEW_RETURN (f,
+ be_factory *added_factory = 0;
+ ACE_NEW_RETURN (added_factory,
be_factory (&sn),
-1);
- be_scope *s = this->ctx_->template_module_inst_scope ();
- s->add_to_scope (f);
- f->set_defined_in (s);
+ idl_global->scopes ().top ()->add_to_scope (added_factory);
- this->ctx_->template_module_inst_scope (f);
+ // Update the scope stack.
+ idl_global->scopes ().push (added_factory);
if (this->visit_scope (node) != 0)
{
@@ -668,12 +605,13 @@ be_visitor_tmpl_module_inst::visit_factory (be_factory *node)
-1);
}
- this->ctx_->template_module_inst_scope (s);
+ // Through with this scope.
+ idl_global->scopes ().pop ();
UTL_ExceptList *reified_exceps =
this->reify_exception_list (node->exceptions ());
- f->be_add_exceptions (reified_exceps);
+ added_factory->be_add_exceptions (reified_exceps);
return 0;
}
diff --git a/modules/TAO/TAO_IDL/be_include/be_visitor_context.h b/modules/TAO/TAO_IDL/be_include/be_visitor_context.h
index b76d4def3bd..476f273aa5b 100644
--- a/modules/TAO/TAO_IDL/be_include/be_visitor_context.h
+++ b/modules/TAO/TAO_IDL/be_include/be_visitor_context.h
@@ -158,9 +158,6 @@ public:
FE_Utils::T_ARGLIST *template_args (void) const;
void template_args (FE_Utils::T_ARGLIST *args);
- be_scope *template_module_inst_scope (void) const;
- void template_module_inst_scope (UTL_Scope *s);
-
// = helpers
// visitors may need the actual type of the node stored in this context. We
@@ -300,10 +297,6 @@ private:
// Storage for the current template module params and args.
FE_Utils::T_PARAMLIST_INFO *template_params_;
FE_Utils::T_ARGLIST *template_args_;
-
- // Scope for adding the instantiated contents of a template
- // module.
- be_scope *template_module_inst_scope_;
};
#if defined (interface)
diff --git a/modules/TAO/TAO_IDL/be_include/be_visitor_reifying.h b/modules/TAO/TAO_IDL/be_include/be_visitor_reifying.h
index b6a97111bae..a5f7f37aa45 100644
--- a/modules/TAO/TAO_IDL/be_include/be_visitor_reifying.h
+++ b/modules/TAO/TAO_IDL/be_include/be_visitor_reifying.h
@@ -27,8 +27,9 @@
#include "be_visitor_decl.h"
-class AST_Decl;
+#include "utl_scoped_name.h"
+class AST_Decl;
class be_param_holder;
class be_visitor_reifying : public be_visitor_decl
@@ -67,7 +68,7 @@ public:
virtual int visit_param_holder (be_param_holder *node);
private:
- bool declared_in_template_module (AST_Decl *d);
+ UTL_ScopedName *template_module_rel_name (AST_Decl *d);
private:
AST_Decl *reified_node_;
diff --git a/modules/TAO/TAO_IDL/include/idl_global.h b/modules/TAO/TAO_IDL/include/idl_global.h
index 6e678e0b3c3..efd7d02cfb0 100644
--- a/modules/TAO/TAO_IDL/include/idl_global.h
+++ b/modules/TAO/TAO_IDL/include/idl_global.h
@@ -555,7 +555,7 @@ public:
void update_prefix (char *filename);
// Do repo id prefix bookkeeping when the file changes.
- UTL_ScopedName *string_to_scoped_name (char *s);
+ UTL_ScopedName *string_to_scoped_name (const char *s);
// Parses a string with double colons.
long seen_include_file_before (char *);
diff --git a/modules/TAO/TAO_IDL/util/utl_global.cpp b/modules/TAO/TAO_IDL/util/utl_global.cpp
index e881e4c64b2..83d7334f978 100644
--- a/modules/TAO/TAO_IDL/util/utl_global.cpp
+++ b/modules/TAO/TAO_IDL/util/utl_global.cpp
@@ -1191,9 +1191,9 @@ IDL_GlobalData::update_prefix (char *filename)
}
UTL_ScopedName *
-IDL_GlobalData::string_to_scoped_name (char *s)
+IDL_GlobalData::string_to_scoped_name (const char *s)
{
- char *start = s;
+ char *start = const_cast<char *> (s);
int len = 0;
UTL_ScopedName *retval = 0;
char tmp[256];
@@ -1203,6 +1203,22 @@ IDL_GlobalData::string_to_scoped_name (char *s)
// a space.
char *test = ACE_OS::strchr (start, ' ');
char *end = ACE_OS::strstr (start, "::");
+
+ // The loop below somehow doesn't cover this simple case.
+ if (test == 0 && end == 0)
+ {
+ // Simple local name.
+ Identifier *simple_id = 0;
+ ACE_NEW_RETURN (simple_id,
+ Identifier (s),
+ 0);
+
+ ACE_NEW_RETURN (retval,
+ UTL_ScopedName (simple_id, 0),
+ 0);
+
+ return retval;
+ }
if (test != 0 && test - end < 0)
{
diff --git a/modules/TAO/TAO_IDL/util/utl_scope.cpp b/modules/TAO/TAO_IDL/util/utl_scope.cpp
index 135a724ba97..22b013c284f 100644
--- a/modules/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/modules/TAO/TAO_IDL/util/utl_scope.cpp
@@ -2107,7 +2107,7 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
// up was inherited into that interface. The first call to
// look_in_inherited() is this function only checks base classes
// of the scope (interface) we started the lookup from.
- if (d == 0)
+ if (d == 0 && s != 0)
{
d = s->look_in_inherited (sn, treat_as_ref);
}