From: drh <> Date: Thu, 14 Apr 2022 18:19:06 +0000 (+0000) Subject: Check for interrupts and invoke the progress handler following a Gosub X-Git-Tag: version-3.39.0~206^2~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d549a702b3b2789156f5697242ea6ae0d1a59b91;p=thirdparty%2Fsqlite.git Check for interrupts and invoke the progress handler following a Gosub opcode, to avoid and recover from infinite subroutine loops. FossilOrigin-Name: 647211e044a5856ceb6bf3e7b78e650fe7d81f8b7bf34568b99b346405ba520c --- diff --git a/manifest b/manifest index 1ed80e82f7..2ea2df5a75 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rerun\sthe\ssubroutines\sthat\scompute\srow-values\sif\snecessary\sfrom\swithin\nthe\sRIGHT\sJOIN\sbody\ssubroutine. -D 2022-04-14T16:34:07.896 +C Check\sfor\sinterrupts\sand\sinvoke\sthe\sprogress\shandler\sfollowing\sa\sGosub\nopcode,\sto\savoid\sand\srecover\sfrom\sinfinite\ssubroutine\sloops. +D 2022-04-14T18:19:06.650 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -624,7 +624,7 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c 602fe229f32a96ceccae4f40824129669582096f7c355f53dbac156c9fecef23 F src/vacuum.c 6c38ddc52f0619865c91dae9c441d4d48bf3040d7dc1bc5b22da1e45547ed0b3 -F src/vdbe.c 85a13807359cdfd9ea94140c16d2ad9d64da99c9287eb8dda84743779fd7e14e +F src/vdbe.c b72147e70498ad005eece5c6336bfa1b9eaff09a673044eb866df8e402d1f12f F src/vdbe.h 89f5edb1422c8783a0b29db836e409876f2b3e847f78e2b21b1fbcc48a93f85f F src/vdbeInt.h ef43f7fdc5fde29fc3fd29c506c12830f366178fdb4edbbf0cbc3dfbd1278b5f F src/vdbeapi.c 354c893f1500cf524cc45c32879b9c68893a28b77e3442c24668d6afe4236217 @@ -1947,8 +1947,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 079b7b125206fb295720612f4853a5b786ec431ab595d35407195844779c149d -R af437a21d494eabd20c43af2912355e1 +P 9b9038bcd0ab5c4f01661456635526cef764f854ff24018a5e6e43825d07eb59 +R 4462ab5ae008c57419f7b3043a0a5f70 U drh -Z 9fe409698cfd512a3fa64bb15b8f5185 +Z 0cc7c2df08ce35b42a210b10f061249d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7303907ef2..1ba5e38a26 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9b9038bcd0ab5c4f01661456635526cef764f854ff24018a5e6e43825d07eb59 \ No newline at end of file +647211e044a5856ceb6bf3e7b78e650fe7d81f8b7bf34568b99b346405ba520c \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 81f552998a..283151d1fc 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -983,12 +983,7 @@ case OP_Gosub: { /* jump */ pIn1->flags = MEM_Int; pIn1->u.i = (int)(pOp-aOp); REGISTER_TRACE(pOp->p1, pIn1); - - /* Most jump operations do a goto to this spot in order to update - ** the pOp pointer. */ -jump_to_p2: - pOp = &aOp[pOp->p2 - 1]; - break; + goto jump_to_p2_and_check_for_interrupt; } /* Opcode: Return P1 P2 P3 * * @@ -1039,7 +1034,12 @@ case OP_InitCoroutine: { /* jump */ assert( !VdbeMemDynamic(pOut) ); pOut->u.i = pOp->p3 - 1; pOut->flags = MEM_Int; - if( pOp->p2 ) goto jump_to_p2; + if( pOp->p2==0 ) break; + + /* Most jump operations do a goto to this spot in order to update + ** the pOp pointer. */ +jump_to_p2: + pOp = &aOp[pOp->p2 - 1]; break; }