[omniORB] Re: typecode problem

Vasily Tchekalkin Bacek@yandex-team.ru
Thu Mar 20 15:52:02 2003


Hello.

Seems I've found possible bug in implementaion CORBA::Any operator=
In this operator don't check sitaution with assinging to self. And I'm 
catching assert later in CORBA::release(TypeCode_ptr o)

This is small patch for it
--- ../omniorb4-4.0.1/src/lib/omniORB/dynamic/any.cc    Wed May 29 
18:40:41 2002
+++ ./src/lib/omniORB/dynamic/any.cc    Thu Mar 20 18:40:55 2003
@@ -294,10 +294,12 @@
  CORBA::Any&
  CORBA::Any::operator=(const CORBA::Any& a)
  {
-  // Delete the old internal AnyP and create a new one,
-  // based on the Any passed to us
-  delete pdAnyP();
-  pd_ptr = new AnyP(pdAnyP2(&a));
+  if(this!=&a){
+    // Delete the old internal AnyP and create a new one,
+    // based on the Any passed to us
+    delete pdAnyP();
+    pd_ptr = new AnyP(pdAnyP2(&a));
+  }
    return *this;
  }



-- 
Vasily Tchekalkin
Yandex development team.