From c42ed16e5c83ca5af8c6b415f17b16bc403e566d Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 26 Jun 2009 14:04:51 +0000 Subject: [PATCH] When sqlite3VdbeAddOp() fails due to an OOM fault, return an address of 1 rather than zero so that there appears to always be a prior instruction. This prevents a negative jump-to address computation in where.c following an OOM fault. (CVS 6822) FossilOrigin-Name: fe02339cb2f61c1e8a356e2d0ce9c3aef6e6cd8d --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/vdbeaux.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 8e3c39db82..a85e50464c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stest\sscript\sproblem\sin\sexclusive.test.\s(CVS\s6821) -D 2009-06-26T12:30:40 +C When\ssqlite3VdbeAddOp()\sfails\sdue\sto\san\sOOM\sfault,\sreturn\san\saddress\sof\s1\nrather\sthan\szero\sso\sthat\sthere\sappears\sto\salways\sbe\sa\sprior\sinstruction.\nThis\sprevents\sa\snegative\sjump-to\saddress\scomputation\sin\swhere.c\sfollowing\nan\sOOM\sfault.\s(CVS\s6822) +D 2009-06-26T14:04:51 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 8b8fb7823264331210cddf103831816c286ba446 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -207,7 +207,7 @@ F src/vdbe.c e7831536ddb11b14ce29f62a17e0e3860944d570 F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a F src/vdbeInt.h 831c254a6eef237ef4664c8381a0137586567007 F src/vdbeapi.c 0ab8ada7260b32031ca97f338caecf0812460624 -F src/vdbeaux.c 569653e18a29904e603542d1e5f8ea6a49ddc2f4 +F src/vdbeaux.c 338d4b4323d9153d918d890e72b02f796ba20663 F src/vdbeblob.c c25d7e7bc6d5917feeb17270bd275fa771f26e5c F src/vdbemem.c 1618f685d19b4bcc96e40b3c478487bafd2ae246 F src/vtab.c 98fbffc5efe68d8107511dec0a650efc7daa9446 @@ -737,7 +737,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P ac1450285025e33fad81e2fb14a06eb85e8ed87a -R 93a1400e20189084799dc0214a9ceb18 -U danielk1977 -Z 7744482958494d5303ddabc5400940aa +P a52ef5a4216f26c617bd1471cd19f3da2a6d2c4c +R 7c553912f88d2576d87919ca301ee243 +U drh +Z 54e939e48b5dd1bf7f258c6a78252ee4 diff --git a/manifest.uuid b/manifest.uuid index 6cebb8891a..f50a384652 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a52ef5a4216f26c617bd1471cd19f3da2a6d2c4c \ No newline at end of file +fe02339cb2f61c1e8a356e2d0ce9c3aef6e6cd8d \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 989e0c5f94..b3924c5490 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -14,7 +14,7 @@ ** to version 2.8.7, all this code was combined into the vdbe.c source file. ** But that file was getting too big so this subroutines were split out. ** -** $Id: vdbeaux.c,v 1.465 2009/06/26 12:15:23 drh Exp $ +** $Id: vdbeaux.c,v 1.466 2009/06/26 14:04:51 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -145,7 +145,7 @@ int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, int p3){ assert( op>0 && op<0xff ); if( p->nOpAlloc<=i ){ if( growOpArray(p) ){ - return 0; + return 1; } } p->nOp++; -- 2.47.3