mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix an assert() failure that could follow an OOM when coding a RETURNING trigger. dbsqlfuzz case 5d3e2438f15dc32b473d9f29413157857efa1212.
FossilOrigin-Name: 7ae596dd4a73a09585c5dc9f4faf75d126d0733fc2fb32c1de64126a1088d967
This commit is contained in:
@@ -945,7 +945,9 @@ static void codeReturningTrigger(
|
||||
sNC.ncFlags = NC_UBaseReg;
|
||||
pParse->eTriggerOp = pTrigger->op;
|
||||
pParse->pTriggerTab = pTab;
|
||||
if( sqlite3ResolveExprListNames(&sNC, pNew)==SQLITE_OK ){
|
||||
if( sqlite3ResolveExprListNames(&sNC, pNew)==SQLITE_OK
|
||||
&& !db->mallocFailed
|
||||
){
|
||||
int i;
|
||||
int nCol = pNew->nExpr;
|
||||
int reg = pParse->nMem+1;
|
||||
@@ -953,8 +955,7 @@ static void codeReturningTrigger(
|
||||
pReturning->iRetReg = reg;
|
||||
for(i=0; i<nCol; i++){
|
||||
Expr *pCol = pNew->a[i].pExpr;
|
||||
assert( pCol!=0 || pParse->db->mallocFailed );
|
||||
if( NEVER(pCol==0) ) continue;
|
||||
assert( pCol!=0 ); /* Due to !db->mallocFailed ~9 lines above */
|
||||
sqlite3ExprCodeFactorable(pParse, pCol, reg+i);
|
||||
if( sqlite3ExprAffinity(pCol)==SQLITE_AFF_REAL ){
|
||||
sqlite3VdbeAddOp1(v, OP_RealAffinity, reg+i);
|
||||
|
Reference in New Issue
Block a user