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

Fix a crash that can follow a malloc() failure in malloc7.test. (CVS 5042)

FossilOrigin-Name: 85eedad186327a1f0b0983413b833efd41640d0e
This commit is contained in:
danielk1977
2008-04-24 12:36:35 +00:00
parent 36961ed23f
commit d7eb2ed5cd
3 changed files with 10 additions and 9 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.367 2008/04/15 12:14:22 drh Exp $
** $Id: expr.c,v 1.368 2008/04/24 12:36:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -2116,7 +2116,8 @@ void sqlite3ExprHardCopy(Parse *pParse, int iReg, int nReg){
v = pParse->pVdbe;
addr = sqlite3VdbeCurrentAddr(v);
pOp = sqlite3VdbeGetOp(v, addr-1);
if( pOp->opcode==OP_SCopy && pOp->p1>=iReg && pOp->p1<iReg+nReg ){
assert( pOp || pParse->db->mallocFailed );
if( pOp && pOp->opcode==OP_SCopy && pOp->p1>=iReg && pOp->p1<iReg+nReg ){
pOp->opcode = OP_Copy;
}
}