diff options
author | jp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-13 22:06:28 +0000 |
---|---|---|
committer | jp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-13 22:06:28 +0000 |
commit | 8bf65b03c9f533702b3f81a4e7856bc1331796d1 (patch) | |
tree | 370b4eb606d7a8603fdd7de803c404715ce46246 | |
parent | d554bc371cdf49af4a74bc0418951a84f2b1cecc (diff) | |
download | ATCD-8bf65b03c9f533702b3f81a4e7856bc1331796d1.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 9 | ||||
-rw-r--r-- | TAO/tao/Any.cpp | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 84a8b90cf11..655b05447c7 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,12 @@ +Tue Oct 13 17:04:15 1998 Jeff Parsons <jp4@cs.wustl.edu> + + * tao/Any.cpp: + Modified copy constructor and assignment operator to avoid + encoding the value of the source Any when it is 0 (which it + is if the Any was constructed from just a typecode. Perhaps + this sequence of calls should never be made, but this guards + against it anyway. + Tue Oct 13 10:51:10 1998 Carlos O'Ryan <coryan@cs.wustl.edu> * tao/ORB.cpp: Thread ids in some platforms (ex: HP-UX) are diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp index a299d50368a..6e13d186bbe 100644 --- a/TAO/tao/Any.cpp +++ b/TAO/tao/Any.cpp @@ -128,7 +128,8 @@ CORBA_Any::CORBA_Any (const CORBA_Any &src) // copies. this->cdr_ = ACE_Message_Block::duplicate (src.cdr_); } - else + // If the any was created from just a typecode, we don't want to do this part + else if (src.value_ != 0) { // "src" did not own the data. So we must do the encoding ourselves TAO_OutputCDR stream; @@ -181,7 +182,8 @@ CORBA_Any::operator= (const CORBA_Any &src) { this->cdr_ = ACE_Message_Block::duplicate (src.cdr_); } - else + // If the source was created from just a typecode, we want to skip this... + else if (src.value_ != 0) { TAO_OutputCDR stream; @@ -189,6 +191,10 @@ CORBA_Any::operator= (const CORBA_Any &src) // retrieve the start of the message block chain and duplicate it this->cdr_ = stream.begin ()->clone (); } + // ... and do this. + else + this->cdr_ = 0; + return *this; } |