Re: [sqlsmith] Infinite recursion in bitshift - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [sqlsmith] Infinite recursion in bitshift
Date
Msg-id 17165.1476473076@sss.pgh.pa.us
Whole thread Raw
In response to [sqlsmith] Infinite recursion in bitshift  (Andreas Seltenreich <seltenreich@gmx.de>)
Responses Re: [sqlsmith] Infinite recursion in bitshift  (Andreas Seltenreich <seltenreich@gmx.de>)
List pgsql-hackers
Andreas Seltenreich <seltenreich@gmx.de> writes:
> sqlsmith just found another crasher:
>     select bit '1' >> (-2^31)::int;

Nice catch :-)

> This is due to an integer overflow in bitshiftright()/bitshiftleft()
> leading to them recursively calling each other.  Patch attached.

Seems sane, though I wonder if it'd be better to use -INT_MAX rather
than -VARBITMAXLEN.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andreas Seltenreich
Date:
Subject: [sqlsmith] Infinite recursion in bitshift
Next
From: Andreas Seltenreich
Date:
Subject: Re: [sqlsmith] Infinite recursion in bitshift