From a3569fb2ca818cfdb63296413949a6169c62b086 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 19 Dec 2023 11:57:29 +0000 Subject: [PATCH] Extra ALWAYS() macros to verify state in the sqlite3ExprCanBeNull() routine. FossilOrigin-Name: be19b84c9f3fe127165809908add148dbe9a827a55608b0490de7e69b7f7f191 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/expr.c | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index a10a16749a..d88f42963c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sa\sstray\scomment\sin\sthe\sJSON\scode. -D 2023-12-19T00:07:38.941 +C Extra\sALWAYS()\smacros\sto\sverify\sstate\sin\sthe\ssqlite3ExprCanBeNull()\sroutine. +D 2023-12-19T11:57:29.394 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -686,7 +686,7 @@ F src/date.c 3b8d02977d160e128469de38493b4085f7c5cf4073193459909a6af3cf6d7c91 F src/dbpage.c 80e46e1df623ec40486da7a5086cb723b0275a6e2a7b01d9f9b5da0f04ba2782 F src/dbstat.c 3b677254d512fcafd4d0b341bf267b38b235ccfddbef24f9154e19360fa22e43 F src/delete.c cb766727c78e715f9fb7ec8a7d03658ed2a3016343ca687acfcec9083cdca500 -F src/expr.c 8f8ed8a5977a54c678755e43aabb3bbe29984025d086128a93e52675987c34eb +F src/expr.c c21c6d1ba6e73b65ad7dd08336956c631b35a3c44935a8b4f26a766493642fa4 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c a47610f0a5c6cb0ad79f8fcef039c01833dec0c751bb695f28dc0ec6a4c3ba00 F src/func.c 472f6dcfa39cf54f89a6aec76c79c225fb880a6c14469c15d361331662b9bf43 @@ -2155,8 +2155,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 a6a1367b0bf364b1a2e20e153c5f4a578624b8846f9ec0b7c9c3cba0ea2ec346 -R 8cbf9e55e2fcc826ff07211e47ebf076 +P 6618bdf0679405b43911ea8cd94050b12a5dc469f3dfe4759ee3ff850a55229e +R faff5376645090f5364e51a25f92344d U drh -Z 1332cee5da58f474b98f2121b7eff333 +Z 32c2d52f17e83189a0a2418901ffc969 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0ba65215cd..3abdc1543e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6618bdf0679405b43911ea8cd94050b12a5dc469f3dfe4759ee3ff850a55229e \ No newline at end of file +be19b84c9f3fe127165809908add148dbe9a827a55608b0490de7e69b7f7f191 \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 756fcc5699..ebe0721cad 100644 --- a/src/expr.c +++ b/src/expr.c @@ -2743,6 +2743,8 @@ int sqlite3ExprCanBeNull(const Expr *p){ p->y.pTab==0 || /* Reference to column of index on expression */ (p->iColumn>=0 && p->y.pTab->aCol!=0 /* Possible due to prior error */ + && ALWAYS(p->iColumn>=0) + && ALWAYS(p->iColumny.pTab->nCol) && p->y.pTab->aCol[p->iColumn].notNull==0); default: return 1;