From: drh Date: Mon, 25 Jan 2016 22:08:11 +0000 (+0000) Subject: Fix a compiler warning about doing pointer arithmetic involving a NULL pointer X-Git-Tag: version-3.11.0~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2aac8c7ba1e84a90b36906926336a4558360a02e;p=thirdparty%2Fsqlite.git Fix a compiler warning about doing pointer arithmetic involving a NULL pointer even though the result of computation is never used. FossilOrigin-Name: 7c49a9478bd36564e81d33458ca1f4063ddaca83 --- diff --git a/manifest b/manifest index 827a3d5126..5a7fe0a637 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Replace\sthe\sOP_SetIfNotPos\soperator\swith\sOP_OffsetLimit\sin\sthe\sVDBE,\sfor\nsimpler\sand\ssmaller\scode. -D 2016-01-25T15:57:29.060 +C Fix\sa\scompiler\swarning\sabout\sdoing\spointer\sarithmetic\sinvolving\sa\sNULL\spointer\neven\sthough\sthe\sresult\sof\scomputation\sis\snever\sused. +D 2016-01-25T22:08:11.961 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 1708a78eda223b6daa302b140037fcc214a779f9 @@ -417,7 +417,7 @@ F src/vdbeapi.c ffae8f5af4570fbd548504e815e9fb7227f0822e F src/vdbeaux.c 757f86e6fef8efb3dd4226cb31e2e82b9c44c883 F src/vdbeblob.c 37c3d11a753e403698c69e17383d282e1ae73e75 F src/vdbemem.c b9181e77eca2a095929d46250daf85c8d2621fc0 -F src/vdbesort.c 0971557e5d3c289e46f56a52aed2197c13251de7 +F src/vdbesort.c 3bb1f1f03162e6d223da623714d8e93fcaeac658 F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0 F src/vtab.c 320682cca733115b4cbe71320b5c5eeb1074ebde F src/vxworks.h 974e7d9a98f602d6310d563e1dc4e08f9fc48e47 @@ -1419,7 +1419,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 30671345b1c1ee55a2d1aa17273213f1849efd81 -R f342889ba3409bd63b1cf54d88bfe0e2 +P 7ac017a498b6fb28343eef2d24e400c7800660d6 +R aa5d51a793ca6d0a7613986a1affa54a U drh -Z e7c5fc86067d4269675714897cec0b51 +Z 142832d114ade2d8f5ff5fab3faed40b diff --git a/manifest.uuid b/manifest.uuid index 276ef7a03f..d34f9b48c8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7ac017a498b6fb28343eef2d24e400c7800660d6 \ No newline at end of file +7c49a9478bd36564e81d33458ca1f4063ddaca83 \ No newline at end of file diff --git a/src/vdbesort.c b/src/vdbesort.c index e095f80912..22029aa6bf 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -1837,7 +1837,9 @@ int sqlite3VdbeSorterWrite( pNew = (SorterRecord*)&pSorter->list.aMemory[pSorter->iMemory]; pSorter->iMemory += ROUND8(nReq); - pNew->u.iNext = (int)((u8*)(pSorter->list.pList) - pSorter->list.aMemory); + if( pSorter->list.pList ){ + pNew->u.iNext = (int)((u8*)(pSorter->list.pList) - pSorter->list.aMemory); + } }else{ pNew = (SorterRecord *)sqlite3Malloc(nReq); if( pNew==0 ){