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

Make sure the left-shift operator never overflows. (CVS 6605)

FossilOrigin-Name: 300da30178c46ab9f2ceb0c3e3ee3eac73d5d8e1
This commit is contained in:
drh
2009-05-05 15:46:43 +00:00
parent e289d6069a
commit 3500ed6650
5 changed files with 21 additions and 16 deletions

View File

@@ -14,7 +14,7 @@
** to version 2.8.7, all this code was combined into the vdbe.c source file.
** But that file was getting too big so this subroutines were split out.
**
** $Id: vdbeaux.c,v 1.455 2009/05/04 11:42:30 danielk1977 Exp $
** $Id: vdbeaux.c,v 1.456 2009/05/05 15:46:43 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -730,9 +730,9 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){
*/
void sqlite3VdbeUsesBtree(Vdbe *p, int i){
int mask;
assert( i>=0 && i<p->db->nDb );
assert( i>=0 && i<p->db->nDb && i<sizeof(u32)*8 );
assert( i<(int)sizeof(p->btreeMask)*8 );
mask = 1<<i;
mask = ((u32)1)<<i;
if( (p->btreeMask & mask)==0 ){
p->btreeMask |= mask;
sqlite3BtreeMutexArrayInsert(&p->aMutex, p->db->aDb[i].pBt);
@@ -1940,7 +1940,7 @@ void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){
int i;
for(i=0; i<pVdbeFunc->nAux; i++){
struct AuxData *pAux = &pVdbeFunc->apAux[i];
if( (i>31 || !(mask&(1<<i))) && pAux->pAux ){
if( (i>31 || !(mask&(((u32)1)<<i))) && pAux->pAux ){
if( pAux->xDelete ){
pAux->xDelete(pAux->pAux);
}