aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-04-07 18:17:56 +0000
committerdrh <>2022-04-07 18:17:56 +0000
commitda4c7ccc075f84dd0f91d6bc6d60e9acebf78292 (patch)
tree5a2919a888a266d908cbd07a173cc5b835171cde /src
parentdb08a6d13c7b868eb42b53d4fac8738ad3d7b477 (diff)
downloadsqlite-da4c7ccc075f84dd0f91d6bc6d60e9acebf78292.tar.gz
sqlite-da4c7ccc075f84dd0f91d6bc6d60e9acebf78292.zip
The ".testctrl optimizations 0x400000" command disables the generation of
OP_ReleaseReg opcodes. OP_ReleaseReg opcodes are usually only generated for SQLITE_DEBUG builds and are used to verify that registers are descoped propertly. But they can get in the way of code understanding when studying bytecode dumps. So this new optimization setting is provided to temporarily turn OP_ReleaseReg opcodes off. FossilOrigin-Name: fa5276725f246cef9d58b27c1e617ee3f873f7a9b88284a4e8fc453ebda338bc
Diffstat (limited to 'src')
-rw-r--r--src/sqliteInt.h1
-rw-r--r--src/vdbeaux.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 9f95ec8a9..a9f3121c7 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1779,6 +1779,7 @@ struct sqlite3 {
#define SQLITE_BloomFilter 0x00080000 /* Use a Bloom filter on searches */
#define SQLITE_BloomPulldown 0x00100000 /* Run Bloom filters early */
#define SQLITE_BalancedMerge 0x00200000 /* Balance multi-way merges */
+#define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */
#define SQLITE_AllOpts 0xffffffff /* All optimizations */
/*
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 551236226..cb2433c2c 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1231,7 +1231,7 @@ void sqlite3VdbeReleaseRegisters(
u32 mask, /* Mask of registers to NOT release */
int bUndefine /* If true, mark registers as undefined */
){
- if( N==0 ) return;
+ if( N==0 || OptimizationDisabled(pParse->db, SQLITE_ReleaseReg) ) return;
assert( pParse->pVdbe );
assert( iFirst>=1 );
assert( iFirst+N-1<=pParse->nMem );