On Fri, Oct 23, 2009 at 5:16 PM, Rob <r...@rmdashr.com> wrote:

> Hi Kenton,
> I was able to reproduce the problem with the code you provided below.  I
> have also hooked up a remote debugger and stepped through the code.
> Apparently the line causing the problem is in FastInt64ToBuffer() as you
> said before.  It's specifically: i = -i (see diff below);
> i=-40 before that statement
> i=-176093659096  after the statement

-40 = -0x28 = 0xffffffffffffffd8 (two's complement)
-176093659096 = -0x28ffffffd8 = 0xffffffd700000028 (two's complement)

Note also:
~0xffffffd7 = 0x00000028

My guess is that the compiler is implementing 64-bit integers in terms of
two 32-bit integers, since I'm guessing your platform is 32-bit.  It looks
like somewhere in the process it is mixing up its registers, and somehow the
upper 32 bits get polluted with data from the lower 32 bits.  Anyway, you
should definitely file a bug report against the compiler.

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to