1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Avoid trying to cast an over-sized floating point value into an integer.

FossilOrigin-Name: 3518cd7cb1feeefc3963da72c2d258d81d8914f1e1f427da28a00b6228cf126c
This commit is contained in:
drh
2022-08-08 16:25:13 +00:00
parent 5e10d892d6
commit 26e817f69b
6 changed files with 24 additions and 14 deletions

View File

@@ -315,8 +315,7 @@ static VdbeCursor *allocateCursor(
*/
static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
i64 iValue;
if( rValue>(double)LARGEST_INT64 || rValue<(double)SMALLEST_INT64 ) return 0;
iValue = (double)rValue;
iValue = sqlite3RealToI64(rValue);
if( sqlite3RealSameAsInt(rValue,iValue) ){
*piValue = iValue;
return 1;