Re: Re: cvs: php-src /ext/sybase_ct

From: Date: Sat, 15 May 2004 18:11:06 +0000
Subject: Re: Re: cvs: php-src /ext/sybase_ct
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-9860@lists.php.net to get a copy of this message
Timm Friebe wrote:
+ case 3: + /* This signals we have an integer datatype, but we need to convert to double if we + * overflow. */ convert_to_double(&result->data[i][j]); + if (Z_DVAL(result->data[i][j]) >= LONG_MIN && Z_DVAL(result->data[i][j]) <= LONG_MAX) { + convert_to_long(&result->data[i][j]); + } break;
Hi Timm, I think this code is broken on 64-bit archs, as doubles lack the precision to accurately represent a 64-bit long. Also, comparing double values with LONG_[MIN|MAX] is dangerous for the same reason. -- regards, Ard

« previous php.internals (#9860) next »