aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parse.y10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y
index 2d5dc8ee3..12621b434 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -22,7 +22,7 @@
}
// Function used to enlarge the parser stack, if needed
-%realloc sqlite3_realloc64
+%realloc parserStackRealloc
%free sqlite3_free
// All token codes are small integers with #defines that begin with "TK_"
@@ -551,6 +551,14 @@ cmd ::= select(X). {
}
return pSelect;
}
+
+ /* Memory allocator for parser stack resizing. This is a thin wrapper around
+ ** sqlite3_realloc() that includes a call to sqlite3FaultSim() to facilitate
+ ** testing.
+ */
+ static void *parserStackRealloc(void *pOld, sqlite3_uint64 newSize){
+ return sqlite3FaultSim(700) ? 0 : sqlite3_realloc(pOld, newSize);
+ }
}
%ifndef SQLITE_OMIT_CTE