mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
Continuing work toward converting the VM into a register machine. (CVS 4707)
FossilOrigin-Name: a6dddebcc5ccbbf3009c9d06163a8b59036331de
This commit is contained in:
12
src/expr.c
12
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.342 2008/01/10 23:50:11 drh Exp $
|
||||
** $Id: expr.c,v 1.343 2008/01/12 12:48:08 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -289,9 +289,8 @@ Expr *sqlite3PExpr(
|
||||
|
||||
/*
|
||||
** When doing a nested parse, you can include terms in an expression
|
||||
** that look like this: #0 #1 #2 ... These terms refer to elements
|
||||
** on the stack. "#0" means the top of the stack.
|
||||
** "#1" means the next down on the stack. And so forth.
|
||||
** that look like this: #1 #2 ... These terms refer to registers
|
||||
** in the virtual machine. #N is the N-th register.
|
||||
**
|
||||
** This routine is called by the parser to deal with on of those terms.
|
||||
** It immediately generates code to store the value in a memory location.
|
||||
@@ -301,7 +300,6 @@ Expr *sqlite3PExpr(
|
||||
Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
|
||||
Vdbe *v = pParse->pVdbe;
|
||||
Expr *p;
|
||||
int depth;
|
||||
if( pParse->nested==0 ){
|
||||
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken);
|
||||
return sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
|
||||
@@ -311,9 +309,7 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
|
||||
if( p==0 ){
|
||||
return 0; /* Malloc failed */
|
||||
}
|
||||
depth = atoi((char*)&pToken->z[1]);
|
||||
p->iTable = ++pParse->nMem;
|
||||
sqlite3VdbeAddOp2(v, OP_Copy, -depth, p->iTable);
|
||||
p->iTable = atoi((char*)&pToken->z[1]);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user