Re: A few cases of left shifting negative integers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A few cases of left shifting negative integers
Date
Msg-id 26124.1440176622@sss.pgh.pa.us
Whole thread Raw
In response to A few cases of left shifting negative integers  (Piotr Stefaniak <postgres@piotr-stefaniak.me>)
Responses Re: A few cases of left shifting negative integers  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> during my testing I've found cases of left-shifting negative integers 
> during run-time and I was recently encouraged to post a report of them, 
> so here it is (done against 960ea971e66bcd621ba88841b4cb85c7f0e7c383).

What's your concern exactly?  The behavior is well-defined, at least as
long as we don't shift far enough to have integer overflow, and I believe
in most of these cases that's not possible.  In int8shl etc, you just get
whatever the machine does with that, which seems fine to me; we do not
document any particular semantics for such cases.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Make HeapTupleSatisfiesMVCC more concurrent
Next
From: Alvaro Herrera
Date:
Subject: Re: remove unused ExecGetScanType