mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
Add a new OP_StackDepth opcode to help detect VDBE stack leaks early,
before they cause damage. For diagnostics in ticket #2832. (CVS 4612) FossilOrigin-Name: 3fd6a267533cedcca9b8ba3533c107d7341a06c6
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle UPDATE statements.
|
||||
**
|
||||
** $Id: update.c,v 1.141 2007/11/11 18:36:34 drh Exp $
|
||||
** $Id: update.c,v 1.142 2007/12/12 12:00:46 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -330,6 +330,7 @@ void sqlite3Update(
|
||||
/* The top of the update loop for when there are triggers.
|
||||
*/
|
||||
addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0);
|
||||
sqlite3VdbeAddOp(v, OP_StackDepth, -1, 0);
|
||||
mem1 = pParse->nMem++;
|
||||
sqlite3VdbeAddOp(v, OP_MemStore, mem1, 0);
|
||||
|
||||
@@ -427,6 +428,7 @@ void sqlite3Update(
|
||||
*/
|
||||
if( !triggers_exist ){
|
||||
addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0);
|
||||
sqlite3VdbeAddOp(v, OP_StackDepth, -1, 0);
|
||||
sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
|
||||
}
|
||||
sqlite3VdbeAddOp(v, OP_NotExists, iCur, addr);
|
||||
|
||||
Reference in New Issue
Block a user