summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-14 20:44:38 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-14 20:44:38 +0000
commit18b2eff052816bd0c993c7b4b7a0eb35d48c637b (patch)
tree74adacaad02e587a75836d43d171e6eebefccea5
parent2bf6aefe411e387de1f148df5fb0ded4f04816ac (diff)
downloadATCD-18b2eff052816bd0c993c7b4b7a0eb35d48c637b.tar.gz
ChangeLogTag: Fri Feb 14 14:37:55 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog15
-rw-r--r--TAO/TAO_IDL/be/be_predefined_type.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp134
3 files changed, 85 insertions, 76 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index a2abdaf83d1..87069327e25 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,18 @@
+Fri Feb 14 14:37:55 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_predefined_type.cpp (compute_repoID):
+
+ Fixed function to catch a reference to CORBA::Object
+ in an IDL file. The repository ID must be handled as
+ a special case, since this node type is not looked up
+ in the AST.
+
+ * TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp:
+
+ Fixed incorrect typecode generation for members of type
+ CORBA::Object. Thanks to Ferran Boladeres Salvadó <bds@iis.fhg.de>
+ for sending in the example code that uncovered the bug.
+
Fri Feb 14 18:39:01 UTC 2003 Craig Rodrigues <crodrigu@bbn.com>
* tao/RTCORBA/RT_ORBInitializer.cpp:
diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp
index b5520ef1995..7c092c7f5cd 100644
--- a/TAO/TAO_IDL/be/be_predefined_type.cpp
+++ b/TAO/TAO_IDL/be/be_predefined_type.cpp
@@ -161,16 +161,8 @@ be_predefined_type::compute_repoID (void)
{
switch (this->pt ())
{
- case AST_PredefinedType::PT_pseudo:
- if (!ACE_OS::strcmp (this->local_name ()->get_string (), "Object"))
- {
- this->repoID_ = ACE::strnew ("IDL:omg.org/CORBA/Object:1.0");
- }
- else
- {
- AST_Decl::compute_repoID ();
- }
-
+ case AST_PredefinedType::PT_object:
+ this->repoID_ = ACE::strnew ("IDL:omg.org/CORBA/Object:1.0");
break;
default:
AST_Decl::compute_repoID ();
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
index a3d720f5608..9d927d4f7d6 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
@@ -1463,83 +1463,85 @@ be_visitor_typecode_defn::gen_typecode (be_predefined_type *node)
case AST_PredefinedType::PT_wchar:
*os << "CORBA::tk_wchar,\n\n";
break;
- case AST_PredefinedType::PT_pseudo:
+ case AST_PredefinedType::PT_object:
{
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "TypeCode"))
- *os << "CORBA::tk_TypeCode,\n\n";
+ // Check if we are repeated.
+ const be_visitor_typecode_defn::QNode *qnode =
+ this->queue_lookup (this->tc_queue_, node);
+
+ if (qnode)
+ {
+ // we are repeated, so we must generate an indirection here
+ *os << "0xffffffff, // indirection" << be_nl;
+ this->tc_offset_ += sizeof (ACE_CDR::ULong);
+ // the offset must point to the tc_kind value of the first occurrence of
+ // this type
+ os->print ("0x%x, // negative offset (%ld)\n",
+ (qnode->offset - this->tc_offset_),
+ (qnode->offset - this->tc_offset_));
+ this->tc_offset_ += sizeof (ACE_CDR::ULong);
+ }
else
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
+ {
+ // Insert node into tc_queue_ in case the node is involved in
+ // some form of recursion.
+ if (this->queue_insert (this->tc_queue_,
+ node,
+ this->tc_offset_) == 0)
{
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_typecode_defn::"
+ "visit_type - "
+ "queue insert failed\n"),
+ -1);
+ }
+
+ *os << "CORBA::tk_objref," << be_nl;
+
+ {
+ Scoped_Compute_Queue_Guard guard (this);
+
+ // emit the encapsulation length
+ this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
+ if (node->accept (this) == -1)
{
- // Insert node into tc_queue_ in case the node is involved in
- // some form of recursion.
- if (this->queue_insert (this->tc_queue_,
- node,
- this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
-
- *os << "CORBA::tk_objref," << be_nl;
-
- {
- Scoped_Compute_Queue_Guard guard (this);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- ACE_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ACE_TEXT ("gen_typecode (predefined) - ")
- ACE_TEXT ("Failed to get encap length\n")), -1);
- }
- }
-
- *os << this->computed_encap_len_
- << ", // encapsulation length" << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ACE_TEXT ("::gen_typecode (predefined objref) - ")
- ACE_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) - be_visitor_typecode_defn")
+ ACE_TEXT ("gen_typecode (predefined) - ")
+ ACE_TEXT ("Failed to get encap length\n")), -1);
}
}
+
+ *os << this->computed_encap_len_
+ << ", // encapsulation length" << be_idt << "\n";
+ // size of the encap length
+ this->tc_offset_ += sizeof (ACE_CDR::ULong);
+
+ // now emit the encapsulation
+ this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
+ if (node->accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
+ ACE_TEXT ("::gen_typecode (predefined objref)")
+ ACE_TEXT (" - failed to generate ")
+ ACE_TEXT ("encapsulation\n")),
+ -1);
+ }
+
+ *os << be_uidt << "\n";
+ }
+
+ break;
}
+ case AST_PredefinedType::PT_pseudo:
+ *os << "CORBA::tk_TypeCode,\n\n";
break;
default:
break;
}
+
return 0;
}