aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-09-13 18:15:15 +0000
committerdrh <drh@noemail.net>2013-09-13 18:15:15 +0000
commitaecd80215cef09101bd4ed42a6ce05b60406b2b3 (patch)
tree0e58737d5bdf7fd19074cedc79a13971fa87ec8a /src/expr.c
parenta496fa7c0248bd666d1260f51b93f9b4ab0732df (diff)
downloadsqlite-aecd80215cef09101bd4ed42a6ce05b60406b2b3.tar.gz
sqlite-aecd80215cef09101bd4ed42a6ce05b60406b2b3.zip
Remove one unreachable branch and add asserts() to dupedExprStructSize().
New asserts verify that removed branch is unused and that constants that are ORed together in the output do not overlap. FossilOrigin-Name: 86ad358b5a7567857f2f998fbb8266b7de9ec87e
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index da8499a60..b8b0eb731 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -739,6 +739,8 @@ static int exprStructSize(Expr *p){
static int dupedExprStructSize(Expr *p, int flags){
int nSize;
assert( flags==EXPRDUP_REDUCE || flags==0 ); /* Only one flag value allowed */
+ assert( EXPR_FULLSIZE<=0xfff );
+ assert( (0xfff & (EP_Reduced|EP_TokenOnly))==0 );
if( 0==(flags&EXPRDUP_REDUCE) ){
nSize = EXPR_FULLSIZE;
}else{
@@ -746,9 +748,10 @@ static int dupedExprStructSize(Expr *p, int flags){
assert( !ExprHasProperty(p, EP_FromJoin) );
assert( !ExprHasProperty(p, EP_MemToken) );
assert( !ExprHasProperty(p, EP_NoReduce) );
- if( p->pLeft || p->pRight || p->x.pList ){
+ if( p->pLeft || p->x.pList ){
nSize = EXPR_REDUCEDSIZE | EP_Reduced;
}else{
+ assert( p->pRight==0 );
nSize = EXPR_TOKENONLYSIZE | EP_TokenOnly;
}
}