From: drh Date: Tue, 6 Aug 2013 16:56:44 +0000 (+0000) Subject: Remove unreachable branches in expr.c, replacing them with assert() and X-Git-Tag: version-3.8.0~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3535ec3e10555c1b75b4854dd6c7a52b99cde816;p=thirdparty%2Fsqlite.git Remove unreachable branches in expr.c, replacing them with assert() and testcase() statements. FossilOrigin-Name: 9103c27ceb3f4023ea3a41b679a10717d3f80210 --- diff --git a/manifest b/manifest index 23e2bb7256..4bb5e63c86 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C For\sthe\s".import"\scommand\sof\sthe\scommand-line\sshell,\sstart\sa\stransaction\nif\sthere\sis\snot\sone\sactive\salready. -D 2013-08-06T14:36:36.363 +C Remove\sunreachable\sbranches\sin\sexpr.c,\sreplacing\sthem\swith\sassert()\sand\ntestcase()\sstatements. +D 2013-08-06T16:56:44.584 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -172,7 +172,7 @@ F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac F src/ctime.c 4262c227bc91cecc61ae37ed3a40f08069cfa267 F src/date.c 067a81c9942c497aafd2c260e13add8a7d0c7dd4 F src/delete.c 2317c814866d9aa71fea16b3faf4fdd4d6a49b94 -F src/expr.c 7e55edefb8bd0b35b382ce9226c58472cd63a443 +F src/expr.c cd4fb5acb6060a2fec30dc07fef7f8113ff3f8ad F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c 914a6bbd987d857c41ac9d244efa6641f36faadb F src/func.c 5c50c1ea31fd864b0fe921fe1a8d4c55acd609ef @@ -1105,7 +1105,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 2b1743d60171635c1e5a6ede6b4928f4671f948d -R 52d68f7d6fd0cf4ecec25cf61e17c3e0 +P 5dcc2d91bd343cd0fac79d3c8f079a5ce534cdf7 +R 4c2c4347dbc9045867f7f93fb89a2b59 U drh -Z 274a34c6d0a826d2bb04d7b9aabecdb7 +Z 4578d43c48945a1e8da3abe73645bfd7 diff --git a/manifest.uuid b/manifest.uuid index a49cab56b3..6f265e5fa6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5dcc2d91bd343cd0fac79d3c8f079a5ce534cdf7 \ No newline at end of file +9103c27ceb3f4023ea3a41b679a10717d3f80210 \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 3857d5d841..5fca1f12c0 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1739,10 +1739,11 @@ int sqlite3CodeSubselect( return 0; } pEList = pExpr->x.pSelect->pEList; - if( pKeyInfo && ALWAYS(pEList!=0 && pEList->nExpr>0) ){ - pKeyInfo->aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, - pEList->a[0].pExpr); - } + assert( pKeyInfo!=0 ); /* OOM will exit after sqlite3Select() */ + assert( pEList!=0 ); + assert( pEList->nExpr>0 ); + pKeyInfo->aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, + pEList->a[0].pExpr); }else if( ALWAYS(pExpr->x.pList!=0) ){ /* Case 2: expr IN (exprlist) **