Re: A few cases of left shifting negative integers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A few cases of left shifting negative integers
Date: 2015-08-21 17:03:42
Message-ID: 26124.1440176622@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-08-21 17:16:23 Re: remove unused ExecGetScanType
Previous Message Tom Lane 2015-08-21 16:44:38 Re: Make HeapTupleSatisfiesMVCC more concurrent