mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
Add some extra tests for malloc failure during expression parsing and execution using fuzzily generated SQL. (CVS 4043)
FossilOrigin-Name: 7522d2fb3204d107b8b4816d7f39c88741f20230
This commit is contained in:
19
src/expr.c
19
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.295 2007/05/29 12:11:30 danielk1977 Exp $
|
||||
** $Id: expr.c,v 1.296 2007/05/30 10:36:47 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -1627,13 +1627,16 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
|
||||
** text z[0..n-1] on the stack.
|
||||
*/
|
||||
static void codeInteger(Vdbe *v, const char *z, int n){
|
||||
int i;
|
||||
if( sqlite3GetInt32(z, &i) ){
|
||||
sqlite3VdbeAddOp(v, OP_Integer, i, 0);
|
||||
}else if( sqlite3FitsIn64Bits(z) ){
|
||||
sqlite3VdbeOp3(v, OP_Int64, 0, 0, z, n);
|
||||
}else{
|
||||
sqlite3VdbeOp3(v, OP_Real, 0, 0, z, n);
|
||||
assert( z || sqlite3MallocFailed() );
|
||||
if( z ){
|
||||
int i;
|
||||
if( sqlite3GetInt32(z, &i) ){
|
||||
sqlite3VdbeAddOp(v, OP_Integer, i, 0);
|
||||
}else if( sqlite3FitsIn64Bits(z) ){
|
||||
sqlite3VdbeOp3(v, OP_Int64, 0, 0, z, n);
|
||||
}else{
|
||||
sqlite3VdbeOp3(v, OP_Real, 0, 0, z, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user