aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vdbeaux.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 8b01fdec6..fab8b705c 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1209,14 +1209,16 @@ void sqlite3VdbeReleaseRegisters(
assert( pParse->pVdbe );
assert( iFirst>=1 );
assert( iFirst+N-1<=pParse->nMem );
- while( N>0 && (mask&1)!=0 ){
- mask >>= 1;
- iFirst++;
- N--;
- }
- while( N>0 && N<=32 && (mask & MASKBIT32(N-1))!=0 ){
- mask &= ~MASKBIT32(N-1);
- N--;
+ if( N<=31 && mask!=0 ){
+ while( N>0 && (mask&1)!=0 ){
+ mask >>= 1;
+ iFirst++;
+ N--;
+ }
+ while( N>0 && N<=32 && (mask & MASKBIT32(N-1))!=0 ){
+ mask &= ~MASKBIT32(N-1);
+ N--;
+ }
}
if( N>0 ){
sqlite3VdbeAddOp3(pParse->pVdbe, OP_ReleaseReg, iFirst, N, *(int*)&mask);