mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Fix a register allocation bug in the VDBE code generator for
PRAGMA integrity_check; FossilOrigin-Name: 88439a866b3b16ad7c308ebe59198662a05e7eeb
This commit is contained in:
23
src/expr.c
23
src/expr.c
@@ -4251,3 +4251,26 @@ void sqlite3ClearTempRegCache(Parse *pParse){
|
||||
pParse->nTempReg = 0;
|
||||
pParse->nRangeReg = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Validate that no temporary register falls within the range of
|
||||
** iFirst..iLast, inclusive. This routine is only call from within assert()
|
||||
** statements.
|
||||
*/
|
||||
#ifdef SQLITE_DEBUG
|
||||
int sqlite3NoTempsInRange(Parse *pParse, int iFirst, int iLast){
|
||||
int i;
|
||||
if( pParse->nRangeReg>0
|
||||
&& pParse->iRangeReg+pParse->nRangeReg<iLast
|
||||
&& pParse->iRangeReg>=iFirst
|
||||
){
|
||||
return 0;
|
||||
}
|
||||
for(i=0; i<pParse->nTempReg; i++){
|
||||
if( pParse->aTempReg[i]>=iFirst && pParse->aTempReg[i]<=iLast ){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif /* SQLITE_DEBUG */
|
||||
|
Reference in New Issue
Block a user