summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-11 19:16:48 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-11 19:16:48 +0000
commit3b5b120df6025697f4ddb997a5c4a2a256d5d378 (patch)
treee5ae85d20633b006c8e0b24fc91504cafa3e4f51
parent400c1b3e24556a704ff6be8f61ad43251dbcae4b (diff)
downloadATCD-3b5b120df6025697f4ddb997a5c4a2a256d5d378.tar.gz
Further mod to lookup functions in response to a bug
in compiling TAO/examples/Event_Comm.idl.
-rw-r--r--TAO/TAO_IDL/util/utl_scope.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp
index fd948268d18..af76203b784 100644
--- a/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/TAO/TAO_IDL/util/utl_scope.cpp
@@ -878,7 +878,7 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
continue;
}
- long equal;
+ long equal = 0;
if (scope_offset == 0)
{
@@ -886,7 +886,13 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
}
else
{
- equal = item_name->compare (e);
+ // If d is an argument in some other scope,
+ // whether or not it matches e is irrelevant,
+ // and can only cause problems if it does.
+ if (d->node_type () != AST_Decl::NT_argument)
+ {
+ equal = item_name->compare (e);
+ }
}
if (equal)
@@ -992,17 +998,21 @@ UTL_Scope::lookup_by_name(UTL_ScopedName *e,
while (1)
{
- d = lookup_by_name_local(e->head(), treat_as_ref, index, scope_offset);
+ d = lookup_by_name_local (e->head (),
+ treat_as_ref,
+ index, scope_offset);
// If we have popped up to a parent scope, we
// must check the other children, if we haven't
// had any luck so far.
- if (d == NULL && scope_offset > 0)
+ while (d == NULL && scope_offset > 1)
{
UTL_ScopeActiveIterator *iter =
new UTL_ScopeActiveIterator (this,
UTL_Scope::IK_both);
+ scope_offset--;
+
while (!iter->is_done ())
{
d = iter->item ();
@@ -1017,7 +1027,7 @@ UTL_Scope::lookup_by_name(UTL_ScopedName *e,
treat_as_ref,
0,
0,
- --scope_offset);
+ scope_offset);
}
else
{