[omniORB] bug: duplication of a nil reference

David Riddoch djr@uk.research.att.com
Thu, 20 Apr 2000 16:15:34 +0100 (BST)


Hi Shawn,


On Thu, 20 Apr 2000, Shawn Bisgrove wrote:

>   I am under the impression that one should be able to
> 
> duplicate a nil reference.  If this is wrong let me
> know.  This problem would arise in the copying of a
> struct containing a nil reference to an object.

It is certainly allowed to duplicate a nil reference.  You example has
illustrated a bug in omniORB, which I have fixed and put into the CVS
repository.


> = test.cc ============================================
> #include "problem.hh"
> 
> void main ()
> {
> 
>    TEST::ProductStructure ps;
>    ps.pInterface = TEST::Product::_nil();
>    TEST::ProductStructure other;
>    ps = other;   // error occurs here
> }
> ======================================================

I am not 100% sure whether or not this is strictly legal.  It is very
unclear in the spec what you are allowed to do before calling ORB_init().

If you want to avoid getting a fix via CVS you can solve this problem by
putting a call to ORB_init() before doing the copy...


Cheers,
David