]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Bug fixes in the function that expands the parser stack.
authordrh <>
Fri, 26 Jan 2024 20:57:19 +0000 (20:57 +0000)
committerdrh <>
Fri, 26 Jan 2024 20:57:19 +0000 (20:57 +0000)
FossilOrigin-Name: e91179fe849760771c3508b1e7d75325183e5c3b029752d0a97dbdbd57188b97

manifest
manifest.uuid
test/misc5.test
tool/lempar.c

index 42fb3ce813e643bffe65cfc2d3fa6d8ce5e45442..e783626ab419fb11178b0b5a8f7e04ee9e33fe05 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Experimental\schanges\sthat\sprevent\sparser\sstack\soverflows\sby\sgrowing\sthe\nparser\sstack\swith\sheap\smemory\swhen\sit\sreaches\sits\slimit.
-D 2024-01-26T20:34:48.241
+C Bug\sfixes\sin\sthe\sfunction\sthat\sexpands\sthe\sparser\sstack.
+D 2024-01-26T20:57:19.823
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -1413,7 +1413,7 @@ F test/misc1.test 8d138a4926ab90617c1aa29ce26e7785ae2b83a4d3a195d543b7374e05589d
 F test/misc2.test 71e746af479119386ac2ed7ab7d81d99970e75b49ffd3e8efffee100b4b5f350
 F test/misc3.test cf3dda47d5dda3e53fc5804a100d3c82be736c9d
 F test/misc4.test 10cd6addb2fa9093df4751a1b92b50440175dd5468a6ec84d0386e78f087db0e
-F test/misc5.test c4aeaa0fa28faa08f2485309c38db4719e6cd1364215d5687a5b96d340a3fa58
+F test/misc5.test 48de5f4220ff1a27922b14b8cf1b977f73c5a49f82b2ccd66bd86c0e53c447d4
 F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
 F test/misc7.test d912f3d45c2989191b797504a220ca225d6be80b21acad22ba0d35f4a9ee4579
 F test/misc8.test 4db9f8be59834cea08c87e9658014080efa02678ef54a088f84fa5647e81fee0
@@ -2073,7 +2073,7 @@ F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
 F tool/index_usage.c f62a0c701b2c7ff2f3e21d206f093c123f222dbf07136a10ffd1ca15a5c706c5
 F tool/kvtest-speed.sh 4761a9c4b3530907562314d7757995787f7aef8f
 F tool/lemon.c 7e5c3c27062c94a40b73a980b8045a4201cb3335165b72ae476040dc513aa533
-F tool/lempar.c fa7ab4dd5bc069ffa276cbd85bea767e6472f4163106b94edd5ad01dd4babdc8
+F tool/lempar.c e560057d6e0f578be64894e70e3d86beee6ae26f4aa5a6fb74fdfff8e75ccb35
 F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9
 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
 F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669
@@ -2161,11 +2161,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 9411337a7b3237366768fc708396da53d67a7a17b6cdc5c6f8932c5ab32217a9
-R de3584eaf5d75ac532effc39455b51de
-T *branch * growable-parser-stack
-T *sym-growable-parser-stack *
-T -sym-trunk *
+P 3fd062905fc20507b7cfc97fa976ac5b57c5b68926bf9136bd5ea4265d2d6528
+R 201c8ebb7c943c92d1f840025296ad42
 U drh
-Z 64ba7e2f532c5b55e706d3959cc36418
+Z 19d016796a5696ebb7583ab93b83b409
 # Remove this line to create a well-formed Fossil manifest.
index acfd13cd30abbe777dfacd9d0659bb4ddbcb408a..d41ff74d9599419b25292cd9bc9e7a35b97a1332 100644 (file)
@@ -1 +1 @@
-3fd062905fc20507b7cfc97fa976ac5b57c5b68926bf9136bd5ea4265d2d6528
\ No newline at end of file
+e91179fe849760771c3508b1e7d75325183e5c3b029752d0a97dbdbd57188b97
\ No newline at end of file
index f7c6048d97a6d0aa69632c13eb3b5e5da9bd9a86..0307c3bb075e16991604ef3c7c3d52c458445037 100644 (file)
@@ -581,9 +581,9 @@ do_test misc5-7.1 {
     append sql "(1+"
     append tail ")"
   }
-  append sql 2$tail
+  append sql 2$tail)
   catchsql $sql
-} {1 {parser stack overflow}}
+} {0 {}}
 
 # Parser stack overflow is silently ignored when it occurs while parsing the
 # schema and PRAGMA writable_schema is turned on.
index d8e64c40ddcdecccae3a090eb95532206c1f8cfb..1ea66e8402c18ee09ba703fcb2350bdd199fcad2 100644 (file)
@@ -293,7 +293,7 @@ static const char *const yyRuleName[] = {
 ** of errors.  Return 0 on success.
 */
 static int yyGrowStack(yyParser *p){
-  int oldSize = 1 + (int)(p->yystackEnd - p->yystack)/sizeof(p->yystack[0]);
+  int oldSize = 1 + (int)(p->yystackEnd - p->yystack);
   int newSize;
   int idx;
   yyStackEntry *pNew;
@@ -303,7 +303,7 @@ static int yyGrowStack(yyParser *p){
   if( p->yystack==p->yystk0 ){
     pNew = YYREALLOC(0, newSize*sizeof(pNew[0]));
     if( pNew==0 ) return 1;
-    memcpy(pNew, p->yystk0, sizeof(p->yystk0));
+    memcpy(pNew, p->yystack, oldSize*sizeof(pNew[0]));
   }else{
     pNew = YYREALLOC(p->yystack, newSize*sizeof(pNew[0]));
     if( pNew==0 ) return 1;