[omniORB] Possible bug in _ptrToInterface method

Alex Shabarshoff shura@uc.ru
Thu, 22 Feb 2001 11:50:32 +0300

Hello omniORBers,

I have the two IDL files:
---------------- a.idl ------------
module M { interface A { void funcA(); }; };
---------------- b.idl ------------
#include "a.idl"
module M { interface B : A { void funcB(); }; };

After the applying omniidl compiler with command line "omniidl -bcxx
b.idl", i got the bSK.cc skeleton file with _ptrToInterface method
like this:

M::_impl_B::_ptrToInterface(const char* id)
  if( !strcmp(id, CORBA::Object::_PD_repoId) )
    return (void*) 1;
  if( !strcmp(id, M::B::_PD_repoId) )
    return (_impl_B*) this;
>  if( !strcmp(id, A::_PD_repoId) )
    return (_impl_A*) this;

  return 0;

In  the  selected  line you can see reference to A::_PD_repoId without
the  module  name  "M". Is this correct? The program linked correctly,
but  sometimes  dies  at  this  line of code because the A::_PD_repoId
points  to  the far galaxy :) This behavior of omniidl tested in 3.0.0
and 3.0.2 versions of omniORB.

BTW,  in method "CORBA::Boolean M::_pof_B::is_a(const char* id) const"
the module name is exist for A::_PD_repoId.

Best regards,  
  Alex Shabarshoff (mailto:shura@uc.ru)

Union Card Processing Company
Chief of Security Systems Development Department
Europay Security Supervisor