1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Make sure that the REGISTER token generates a valid Expr. REGISTER will

cause the tokenizer to abort, but the parser might do several reduce
actions prior to that abort and those reduce actions sometimes need a
valid Expr. (CVS 3980)

FossilOrigin-Name: d146f01a02579339c5dc86bbe59f246bd6c05c63
This commit is contained in:
drh
2007-05-11 00:20:08 +00:00
parent e718efe113
commit db83f8231f
5 changed files with 114 additions and 15 deletions

View File

@@ -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.289 2007/05/10 10:46:56 danielk1977 Exp $
** $Id: expr.c,v 1.290 2007/05/11 00:20:08 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -280,9 +280,10 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
Vdbe *v = pParse->pVdbe;
Expr *p;
int depth;
static const Token zeroToken = { (u8*)"0", 0, 1 };
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken);
return 0;
return sqlite3Expr(TK_INTEGER, 0, 0, &zeroToken);
}
if( v==0 ) return 0;
p = sqlite3Expr(TK_REGISTER, 0, 0, pToken);