Changeset: 5423545b564c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5423545b564c
Modified Files:
        sql/storage/bat/bat_storage.c
Branch: Sep2022
Log Message:

Fully initialize *n before adding it to linked list.


diffs (26 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -125,14 +125,17 @@ new_segment(segment *o, sql_trans *tr, s
                n->ts = tr->tid;
                n->oldts = 0;
                n->deleted = false;
-               n->start = 0;
+               if (o) {
+                       n->start = o->end;
+                       n->end = o->end + cnt;
+               } else {
+                       n->start = 0;
+                       n->end = cnt;
+               }
                n->next = NULL;
                n->prev = NULL;
-               if (o) {
-                       n->start = o->end;
+               if (o)
                        o->next = n;
-               }
-               n->end = n->start + cnt;
        }
        return n;
 }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to