Re: Text search segmentation fault - Mailing list pgsql-general

From Tom Lane
Subject Re: Text search segmentation fault
Date
Msg-id 8383.1233244879@sss.pgh.pa.us
Whole thread Raw
In response to Re: Text search segmentation fault  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Text search segmentation fault
List pgsql-general
Gregory Stark <stark@enterprisedb.com> writes:
> Maybe I'm missing something but I don't understand how this fixes the problem.
> s is a "char*" so type punning it to an unsigned char * before dereferencing
> it is really the same as casting it to unsigned char directly

No, it isn't.  If char is signed then you'll get quite different results
from a high-bit-set byte value, because sign extension will happen
before the value is reinterpreted as unsigned.

            regards, tom lane

pgsql-general by date:

Previous
From: Mark Styles
Date:
Subject: Re: Changing owner of pg_toast tables
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: Text search segmentation fault