[omniORB] CORBA::TypeCode::member_label() bug

Sai-Lai Lo S.Lo@uk.research.att.com
05 Jul 1999 10:30:43 +0100


Thanks. The bug is now fixed.



>>>>> Douglas Kosovic writes:

> Hi,
> I just want to report a minor bug for
> CORBA::TypeCode::member_label(CORBA::ULong i) for a IDL Union with a
> default member.

> The label returned by member_label for the default member should be the
> zero octet (currently returns a zero label of the same kind as the
> discriminator).

> The attached patch should fix the problem.

> Thanks,
> Doug.*** src/lib/omniORB2/dynamic/typecode.cc	Mon Jul  5 10:53:00 1999
> --- newsrc/lib/omniORB2/dynamic/typecode.cc	Mon Jul  5 10:53:50 1999
> ***************
> *** 2903,2909 ****
>   {
>     CORBA::Any* a = new CORBA::Any;
>     if( !a )  _CORBA_new_operator_return_null();
> !   TypeCode_union_helper::insertLabel(*a, pd_members[i].alabel, pd_discrim_tc);
>     return a;
>   }
  
> --- 2903,2916 ----
>   {
>     CORBA::Any* a = new CORBA::Any;
>     if( !a )  _CORBA_new_operator_return_null();
> ! 
> !   if( i != pd_default ) {
> !     TypeCode_union_helper::insertLabel(*a, pd_members[i].alabel,
> ! 				       pd_discrim_tc);
> !   } else {
> !     (*a) <<= CORBA::Any::from_octet((CORBA::Octet)0);
> !   }
> ! 
>     return a;
>   }
  

-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND