Fossil SCM

Add an assert() in a block which cannot happen. It survives 'reconstruct', so we can probably remove the block, but leaving it around for a while seems prudent.

stephan 2025-08-07 19:46 trunk
Commit 7d4af37f39acbdbe335203be809e5597d2d17fcaa584d595ae64eb7c9d8a9cbc
1 file changed +1
--- src/content.c
+++ src/content.c
@@ -600,10 +600,11 @@
600600
);
601601
db_bind_blob(&s1, ":data", &cmpr);
602602
db_exec(&s1);
603603
rid = db_last_insert_rowid();
604604
if( !pBlob ){
605
+ assert(!"cannot happen: pBlob is always non-NULL");
605606
db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
606607
}
607608
}
608609
if( g.markPrivate || isPrivate ){
609610
db_multi_exec("INSERT OR IGNORE INTO private VALUES(%d)", rid);
610611
--- src/content.c
+++ src/content.c
@@ -600,10 +600,11 @@
600 );
601 db_bind_blob(&s1, ":data", &cmpr);
602 db_exec(&s1);
603 rid = db_last_insert_rowid();
604 if( !pBlob ){
 
605 db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
606 }
607 }
608 if( g.markPrivate || isPrivate ){
609 db_multi_exec("INSERT OR IGNORE INTO private VALUES(%d)", rid);
610
--- src/content.c
+++ src/content.c
@@ -600,10 +600,11 @@
600 );
601 db_bind_blob(&s1, ":data", &cmpr);
602 db_exec(&s1);
603 rid = db_last_insert_rowid();
604 if( !pBlob ){
605 assert(!"cannot happen: pBlob is always non-NULL");
606 db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid);
607 }
608 }
609 if( g.markPrivate || isPrivate ){
610 db_multi_exec("INSERT OR IGNORE INTO private VALUES(%d)", rid);
611

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button