aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-04-11 15:36:03 +0000
committerdrh <drh@noemail.net>2008-04-11 15:36:03 +0000
commit5c070538f11565ab238c19e7f1988697030c2523 (patch)
tree707864070d1e8a95fbb1448f8a94b00fd59ccf9c /src/expr.c
parent26c9b5eabacc62068408853c7f126f9e49f460d1 (diff)
downloadsqlite-5c070538f11565ab238c19e7f1988697030c2523.tar.gz
sqlite-5c070538f11565ab238c19e7f1988697030c2523.zip
Additional reductions in the use of memset(). (CVS 4988)
FossilOrigin-Name: 38746c54385e3cb456cda660ea50769b5424db30
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index a17085cc4..3002ef7b1 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.365 2008/04/01 18:04:11 drh Exp $
+** $Id: expr.c,v 1.366 2008/04/11 15:36:03 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -266,7 +266,8 @@ Expr *sqlite3Expr(
const Token *pToken /* Argument token */
){
Expr *pNew;
- pNew = sqlite3DbMallocZero(db, sizeof(Expr));
+ static const Expr zeroExpr;
+ pNew = sqlite3DbMallocRaw(db, sizeof(Expr));
if( pNew==0 ){
/* When malloc fails, delete pLeft and pRight. Expressions passed to
** this function must always be allocated with sqlite3Expr() for this
@@ -276,6 +277,7 @@ Expr *sqlite3Expr(
sqlite3ExprDelete(pRight);
return 0;
}
+ *pNew = zeroExpr;
pNew->op = op;
pNew->pLeft = pLeft;
pNew->pRight = pRight;