Wireshark-dev: Re: [Wireshark-dev] Memory corruption on x86_64 / GCC 4.2.3
From: Alexey Neyman <avn@xxxxxxxxxxxxxxx>
Date: Sun, 3 Aug 2008 14:02:56 -0700
On Sunday 03 August 2008 12:05:33 Guy Harris wrote:
> 	-fwrapv
> 		This option instructs the compiler to assume that signed arithmetic
> overflow of addition, subtraction and multiplication wraps around
> using twos-complement representation. This flag enables some
> optimizations and disables others. This option is enabled by default
> for the Java front-end, as required by the Java language
> specification.
>
> We only run on two's-complement platforms, as far as I know (no
> Univac mainframes run Wireshark, as far as I know), so, unless signed
> arithmetic overflow causes a trap, addition and subtraction
> presumably wrap around.  Does turning that option on fix this
> problem?

Yes, it does.

Best regards,
Alexey Neyman.