Re: possible bug?



Hi, Michael,


>From: Michael Meeks <michael@ximian.com>
>To: dou wen <orbkernel@hotmail.com>
>CC: orbit <orbit-list@gnome.org>
>Subject: Re: possible bug?
>Date: 09 Mar 2002 22:32:20 +0000
>	Problem is, moving the pointer like that is going to cause no end of
>grief if you try to free that (moved) pointer, so the patch is not so
>good as it stands.

ahhh,  i made a so silly miskake,
>	I'll commit a modified fix for you.

	Thanks.

more, if this can save your time, here i have a new patch, compared to 
ALIGN_ADDRESS, only plus a "add" operation.

best regards
                                              dou wen

_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer£ºhttp://explorer.msn.com/lccn/intl.asp¡£
diff -Naur ORBit2-2.3.103/src/orb/GIOP/giop-recv-buffer.c 
ORBit2-2.3.103-fix/src/orb/GIOP/giop-recv-buffer.c
--- ORBit2-2.3.103/src/orb/GIOP/giop-recv-buffer.c	Mon Jan 14 23:59:51 2002
+++ ORBit2-2.3.103-fix/src/orb/GIOP/giop-recv-buffer.c	Sun Mar 10 11:35:13 
2002
@@ -196,8 +196,7 @@
   buf->msg.u.request_1_2.service_context._buffer = NULL;
   if(giop_IOP_ServiceContextList_demarshal(buf, 
&buf->msg.u.request_1_2.service_context))
     return TRUE;
-  buf->cur = ALIGN_ADDRESS(buf->cur, 8);
-
+  buf->cur = buf->message_body + ALIGN_VALUE(buf->cur - buf->message_body, 
8) ;
   return FALSE;
}

@@ -255,7 +254,7 @@
   if(giop_IOP_ServiceContextList_demarshal(buf, 
&buf->msg.u.reply_1_2.service_context))
     return TRUE;

-  buf->cur = ALIGN_ADDRESS(buf->cur, 8);
+  buf->cur = buf->message_body + ALIGN_VALUE(buf->cur - buf->message_body, 
8) ;
   return FALSE;
}

@@ -830,6 +829,8 @@
		return TRUE;

	buf->message_body = g_malloc (buf->msg.header.message_size + 12);
+	/*this assert make sure the alignment is 8*/
+	g_assert(buf->message_body && 0x07 == 0);
	buf->free_body = TRUE;
	buf->cur = buf->message_body + 12;
	buf->end = buf->cur + buf->msg.header.message_size;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]