summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2001-07-16 19:38:59 +0000
committerbala <balanatarajan@users.noreply.github.com>2001-07-16 19:38:59 +0000
commit949213d9446b145849c89ac6d15faa8e0f31150f (patch)
treecf037c3c7ee2677e17992ba7f80c9f2a980f2aad
parent7fb78ea814cbc9abe6b436e687390ef0358a47db (diff)
downloadATCD-949213d9446b145849c89ac6d15faa8e0f31150f.tar.gz
ChangeLogTag: Mon Jul 16 14:25:23 2001 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a9
-rw-r--r--TAO/tao/GIOP_Message_State.cpp24
2 files changed, 21 insertions, 12 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index f49571f2471..ce090f29bdc 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,12 @@
+Mon Jul 16 14:25:23 2001 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * tao/GIOP_Message_State.cpp (read_ulong): Looks like some of the
+ compilers have problems when they try to dereference a pointer
+ got out of reinterpret_cast'ing another pointer. The problem
+ showed up on solaris builds. The fix that has been applied is to
+ make a local copy on the stack of the data that is needed before
+ calling a reinterpret_cast on it.
+
Mon Jul 16 11:44:30 2001 Balachandran Natarajan <bala@cs.wustl.edu>
* tests/Big_Reply/server.cpp: The reply sent was too huge. The bug
diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp
index 5c736573a2b..82ccec8d474 100644
--- a/TAO/tao/GIOP_Message_State.cpp
+++ b/TAO/tao/GIOP_Message_State.cpp
@@ -248,27 +248,27 @@ TAO_GIOP_Message_State::read_ulong (char *rd_ptr)
{
CORBA::ULong x = 0;
- // @@todo: This is so funny.. I am not sure why and with what in
- // mind I had aligned this to 4 byte boundary when I was reading
- // from the stream. Maybe when I was a kid:-). This definitely
- // creates problems. Maybe we should revisit this if there is a
- // pellmell.
- // size_t msg_size = 4;
-
- // char *buf = ACE_ptr_align_binary (rd_ptr,
- // msg_size);
+ // We dont need to do this sort of copy. But some compilers (read it
+ // as solaris ones) have a problem in deferencing from the
+ // reinterpret_cast pointer of the <rd_ptr>, as the <rd_ptr> can be
+ // on stack. So let us go ahead with this copying...
+ char buf [4];
+ buf[0] = *rd_ptr;
+ buf[1] = *(rd_ptr + 1);
+ buf[2] = *(rd_ptr + 2);
+ buf[3] = *(rd_ptr + 3);
#if !defined (ACE_DISABLE_SWAP_ON_READ)
if (!(this->byte_order_ != ACE_CDR_BYTE_ORDER))
{
- x = *ACE_reinterpret_cast (ACE_CDR::ULong*, rd_ptr);
+ x = *ACE_reinterpret_cast (ACE_CDR::ULong*, buf);
}
else
{
- ACE_CDR::swap_4 (rd_ptr, ACE_reinterpret_cast (char*, &x));
+ ACE_CDR::swap_4 (buf, ACE_reinterpret_cast (char*, &x));
}
#else
- x = *ACE_reinterpret_cast(ACE_CDR::ULong*, rd_ptr);
+ x = *ACE_reinterpret_cast(ACE_CDR::ULong*, buf);
#endif /* ACE_DISABLE_SWAP_ON_READ */
return x;