On 8/3/2010 4:08 PM, Tom Lane wrote:
However, most of the cases that seem of interest so far are in fairly
small, stable functions. Would it be reasonable to attach a "checked
for overflow problems" label to these functions as a whole?
This should work great. I'll get my clang hacker to start
Tom, would you be willing to isolate these operations into functions
that could be marked with a "no_overflow_check" attribute? This would
be easy for us to deal with, would survive preprocesing cleanly, and
wouldn't have any performance cost since inliners do a fine job.
John
On 8/3/2010
Just to follow up: all the other ones seem to be non-problems.
Would you folks be willing to specify which arithmetic operations are
considered to be safe in the case of overflow? Something simple like an
"INTEGER_OVERFLOW_OK" comment at the end of the line of code containing
the operation w
John Regehr writes:
> Tom, would you be willing to isolate these operations into functions
> that could be marked with a "no_overflow_check" attribute? This would
> be easy for us to deal with, would survive preprocesing cleanly, and
> wouldn't have any performance cost since inliners do a fin
John Regehr writes:
>> Just to follow up: all the other ones seem to be non-problems.
> Would you folks be willing to specify which arithmetic operations are
> considered to be safe in the case of overflow? Something simple like an
> "INTEGER_OVERFLOW_OK" comment at the end of the line of code
Greg Stark writes:
> On Tue, Aug 3, 2010 at 3:33 AM, Tom Lane wrote:
>> Since this is a nearly-dead legacy datatype, I can't get excited about
>> spending a lot of time on it. What I suggest we do is do the difference
>> calculation in int64 arithmetic instead of int32.
> At some level this is
On Tue, Aug 3, 2010 at 3:33 AM, Tom Lane wrote:
> Although this is the worst case, you could easily get overflows from
> intervals with ordinary endpoints that are sufficiently far apart.
Oh, duh, this is pretty obvious in retrospect.
> Since this is a nearly-dead legacy datatype, I can't get ex
Greg Stark writes:
> On Mon, Aug 2, 2010 at 7:16 PM, John Regehr wrote:
>> : Op: -, Reason : Signed Subtraction Overflow,
>> BINARY OPERATION: left (int32): 2147483644 right (int32): -2147483648
>>
>> : Op: -, Reason : Signed Subtraction Overflow,
>> BINARY OPERATION: left (int32): 2147483644
Greg Stark writes:
> On Mon, Aug 2, 2010 at 7:16 PM, John Regehr wrote:
>> : Op: -, Reason : Signed Subtraction Overflow,
>> BINARY OPERATION: left (int32): 2147483644 right (int32): -2147483648
>>
>> : Op: -, Reason : Signed Subtraction Overflow,
>> BINARY OPERATION: left (int32): 2147483644
On Mon, Aug 2, 2010 at 7:16 PM, John Regehr wrote:
> : Op: -, Reason : Signed Subtraction Overflow,
> BINARY OPERATION: left (int32): 2147483644 right (int32): -2147483648
>
> : Op: -, Reason : Signed Subtraction Overflow,
> BINARY OPERATION: left (int32): 2147483644 right (int32): -2147483648
>
10 matches
Mail list logo