File: | programs/pluto/list_entry.c |
Warning: | line 128, column 22 Access to field 'newer' results in a dereference of a null pointer (loaded from field 'older') |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* State lists and hash tables, for libreswan | |||
2 | * | |||
3 | * Copyright (C) 2015-2019 Andrew Cagney <cagney@gnu.org> | |||
4 | * Copyright (C) 2019 D. Hugh Redelmeier <hugh@mimosa.com> | |||
5 | * | |||
6 | * This program is free software; you can redistribute it and/or modify it | |||
7 | * under the terms of the GNU General Public License as published by the | |||
8 | * Free Software Foundation; either version 2 of the License, or (at your | |||
9 | * option) any later version. See <https://www.gnu.org/licenses/gpl2.txt>. | |||
10 | * | |||
11 | * This program is distributed in the hope that it will be useful, but | |||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |||
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |||
14 | * for more details. | |||
15 | */ | |||
16 | ||||
17 | #include <stdint.h> | |||
18 | ||||
19 | #include "passert.h" | |||
20 | #include "defs.h" | |||
21 | #include "log.h" | |||
22 | #include "hash_table.h" | |||
23 | ||||
24 | #define passert_entry(ENTRY, ASSERTION){ _Bool a_ = ASSERTION; if (!a_) { for (char lswbuf[((size_t) 1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ( (void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf ), sizeof(lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: ", (ENTRY)->info->name); jam_list_entry(buf, (ENTRY)); jam(buf, ": %s", "ASSERTION"); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 24, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } } \ | |||
25 | { \ | |||
26 | bool_Bool a_ = ASSERTION; /* evaluate once */ \ | |||
27 | if (!a_) { \ | |||
28 | JAMBUF(buf)for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = &jambuf ; buf != ((void*)0); buf = ((void*)0)) { \ | |||
29 | jam(buf, "%s: ", \ | |||
30 | (ENTRY)->info->name); \ | |||
31 | jam_list_entry(buf, (ENTRY)); \ | |||
32 | jam(buf, ": %s", #ASSERTION); \ | |||
33 | /* XXX: hack: double copy */ \ | |||
34 | log_pexpect(HERE, PRI_SHUNK, \llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 34, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)) | |||
35 | pri_shunk(jambuf_as_shunk(buf)))llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 34, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); \ | |||
36 | } \ | |||
37 | } \ | |||
38 | } | |||
39 | ||||
40 | #define passert_info(INFO, ASSERTION){ _Bool a_ = ASSERTION; if (!a_) { for (char lswbuf[((size_t) 1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ( (void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf ), sizeof(lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: %s", (INFO)->name, "ASSERTION" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 40, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } } \ | |||
41 | { \ | |||
42 | bool_Bool a_ = ASSERTION; /* evaluate once */ \ | |||
43 | if (!a_) { \ | |||
44 | JAMBUF(buf)for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = &jambuf ; buf != ((void*)0); buf = ((void*)0)) { \ | |||
45 | jam(buf, "%s: %s", \ | |||
46 | (INFO)->name, \ | |||
47 | #ASSERTION); \ | |||
48 | /* XXX: hack: double copy */ \ | |||
49 | log_pexpect(HERE, PRI_SHUNK, \llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 49, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)) | |||
50 | pri_shunk(jambuf_as_shunk(buf)))llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 49, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); \ | |||
51 | } \ | |||
52 | } \ | |||
53 | } | |||
54 | ||||
55 | void jam_list_entry(struct jambuf *buf, const struct list_entry *entry) | |||
56 | { | |||
57 | if (entry == NULL((void*)0)) { | |||
58 | jam(buf, "(null)"); | |||
59 | } else { | |||
60 | if (entry->data == NULL((void*)0)) { | |||
61 | jam(buf, "HEAD"); | |||
62 | } else { | |||
63 | entry->info->jam(buf, entry->data); | |||
64 | } | |||
65 | jam(buf, " %p<-%p->%p", entry->older, entry, entry->newer); | |||
66 | } | |||
67 | } | |||
68 | ||||
69 | static void log_entry(const char *op, struct list_entry *entry) | |||
70 | { | |||
71 | passert(entry != NULL)({ _Bool assertion__ = entry != ((void*)0); if (!assertion__) { where_t here = ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c", .line = 71 , }; &here; }); const struct logger *logger_ = &failsafe_logger ; llog_passert(logger_, here, "%s", "entry != ((void*)0)"); } (void) 1; }); | |||
72 | if (DBGP(DBG_TMI)(cur_debugging & (((lset_t)1 << (DBG_TMI_IX))))) { | |||
73 | LSWLOG_DEBUG(buf)for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = &jambuf ; buf != ((void*)0); buf = ((void*)0)) for (; buf != ((void*) 0); jambuf_to_logger(buf, &failsafe_logger, DEBUG_STREAM) , buf = ((void*)0)) { | |||
74 | jam(buf, "%s: %s ", entry->info->name, op); | |||
75 | jam_list_entry(buf, entry); | |||
76 | } | |||
77 | } | |||
78 | if (entry->newer != NULL((void*)0) || entry->older != NULL((void*)0)) { | |||
79 | passert_entry(entry, entry->newer != NULL){ _Bool a_ = entry->newer != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->newer != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 79, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
80 | passert_entry(entry, entry->newer->older == entry){ _Bool a_ = entry->newer->older == entry; if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ( (void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->newer->older == entry" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 80, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
81 | passert_entry(entry, entry->older != NULL){ _Bool a_ = entry->older != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->older != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 81, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
82 | passert_entry(entry, entry->older->newer == entry){ _Bool a_ = entry->older->newer == entry; if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ( (void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->older->newer == entry" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 82, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
83 | } | |||
84 | } | |||
85 | ||||
86 | struct list_entry list_entry(const struct list_info *info, | |||
87 | void *data) | |||
88 | { | |||
89 | passert_info(info, info != NULL){ _Bool a_ = info != ((void*)0); if (!a_) { for (char lswbuf[ ((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf ), sizeof(lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: %s", (info)->name, "info != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 89, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
90 | passert_info(info, data != NULL){ _Bool a_ = data != ((void*)0); if (!a_) { for (char lswbuf[ ((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf ), sizeof(lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: %s", (info)->name, "data != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 90, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
91 | ||||
92 | return (struct list_entry) { | |||
93 | .older = NULL((void*)0), | |||
94 | .newer = NULL((void*)0), | |||
95 | .data = data, | |||
96 | .info = info, | |||
97 | }; | |||
98 | } | |||
99 | ||||
100 | bool_Bool detached_list_entry(const struct list_entry *entry) | |||
101 | { | |||
102 | passert_entry(entry, entry->data != NULL){ _Bool a_ = entry->data != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->data != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 102, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; /* entry is not a list head */ | |||
103 | passert_entry(entry, (entry->newer == NULL) == (entry->newer == NULL)){ _Bool a_ = (entry->newer == ((void*)0)) == (entry->newer == ((void*)0)); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*) 0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof (lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void *)0)) { jam(buf, "%s: ", (entry)->info->name); jam_list_entry (buf, (entry)); jam(buf, ": %s", "(entry->newer == NULL) == (entry->newer == NULL)" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 103, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
104 | return entry->newer == NULL((void*)0); | |||
105 | } | |||
106 | ||||
107 | void insert_list_entry(struct list_head *list, | |||
108 | struct list_entry *entry) | |||
109 | { | |||
110 | passert_entry(entry, entry->info != NULL){ _Bool a_ = entry->info != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->info != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 110, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
| ||||
111 | passert_entry(entry, entry->data != NULL){ _Bool a_ = entry->data != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->data != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 111, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
112 | if (DBGP(DBG_TMI)(cur_debugging & (((lset_t)1 << (DBG_TMI_IX))))) { | |||
113 | LSWLOG_DEBUG(buf)for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = &jambuf ; buf != ((void*)0); buf = ((void*)0)) for (; buf != ((void*) 0); jambuf_to_logger(buf, &failsafe_logger, DEBUG_STREAM) , buf = ((void*)0)) { | |||
114 | jam(buf, "%s: inserting ", | |||
115 | entry->info->name); | |||
116 | jam_list_entry(buf, entry); | |||
117 | jam(buf, " into list "); | |||
118 | jam_list_entry(buf, &list->head); | |||
119 | } | |||
120 | } | |||
121 | passert_entry(entry, list->head.info == entry->info){ _Bool a_ = list->head.info == entry->info; if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = &jambuf ; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry )->info->name); jam_list_entry(buf, (entry)); jam(buf, ": %s" , "list->head.info == entry->info"); llog_pexpect(& failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c", .line = 121 , }; &here; }), "%.*s", ((int) (jambuf_as_shunk(buf)).len ), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
122 | passert_entry(entry, entry->data != NULL){ _Bool a_ = entry->data != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->data != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 122, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
123 | passert_entry(entry, entry->older == NULL && entry->newer == NULL){ _Bool a_ = entry->older == ((void*)0) && entry-> newer == ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024 )], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void *)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof (lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void *)0)) { jam(buf, "%s: ", (entry)->info->name); jam_list_entry (buf, (entry)); jam(buf, ": %s", "entry->older == NULL && entry->newer == NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 123, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
124 | passert_entry(entry, list->head.newer != NULL && list->head.older != NULL){ _Bool a_ = list->head.newer != ((void*)0) && list ->head.older != ((void*)0); if (!a_) { for (char lswbuf[(( size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf ), sizeof(lswbuf)), *buf = &jambuf; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info->name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "list->head.newer != NULL && list->head.older != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 124, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
125 | /* insert at the front */ | |||
126 | entry->newer = &list->head; | |||
127 | entry->older = list->head.older; | |||
128 | entry->older->newer = entry; | |||
| ||||
129 | entry->newer->older = entry; | |||
130 | /* list->newer = list->newer; */ | |||
131 | if (DBGP(DBG_TMI)(cur_debugging & (((lset_t)1 << (DBG_TMI_IX))))) { | |||
132 | LSWLOG_DEBUG(buf)for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = &jambuf ; buf != ((void*)0); buf = ((void*)0)) for (; buf != ((void*) 0); jambuf_to_logger(buf, &failsafe_logger, DEBUG_STREAM) , buf = ((void*)0)) { | |||
133 | jam(buf, "%s: inserted ", | |||
134 | entry->info->name); | |||
135 | jam_list_entry(buf, entry); | |||
136 | jam(buf, " into list "); | |||
137 | jam_list_entry(buf, &list->head); | |||
138 | } | |||
139 | } | |||
140 | } | |||
141 | ||||
142 | void remove_list_entry(struct list_entry *entry) | |||
143 | { | |||
144 | log_entry("removing", entry); | |||
145 | ||||
146 | /* entry is not a list head */ | |||
147 | passert_entry(entry, entry->data != NULL){ _Bool a_ = entry->data != ((void*)0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf; lswbuf_ != ((void *)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf ((lswbuf), sizeof(lswbuf)), *buf = &jambuf; buf != ((void *)0); buf = ((void*)0)) { jam(buf, "%s: ", (entry)->info-> name); jam_list_entry(buf, (entry)); jam(buf, ": %s", "entry->data != NULL" ); llog_pexpect(&failsafe_logger, ({ static const struct where here = { .func = __func__, .file = "programs/pluto/list_entry.c" , .line = 147, }; &here; }), "%.*s", ((int) (jambuf_as_shunk (buf)).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
148 | ||||
149 | /* unlink: older - entry - newer */ | |||
150 | struct list_entry *newer = entry->newer; | |||
151 | struct list_entry *older = entry->older; | |||
152 | passert_entry(entry, older != NULL && newer != NULL){ _Bool a_ = older != ((void*)0) && newer != ((void*) 0); if (!a_) { for (char lswbuf[((size_t)1024)], *lswbuf_ = lswbuf ; lswbuf_ != ((void*)0); lswbuf_ = ((void*)0)) for (struct jambuf jambuf = array_as_jambuf((lswbuf), sizeof(lswbuf)), *buf = & jambuf; buf != ((void*)0); buf = ((void*)0)) { jam(buf, "%s: " , (entry)->info->name); jam_list_entry(buf, (entry)); jam (buf, ": %s", "older != NULL && newer != NULL"); llog_pexpect (&failsafe_logger, ({ static const struct where here = { . func = __func__, .file = "programs/pluto/list_entry.c", .line = 152, }; &here; }), "%.*s", ((int) (jambuf_as_shunk(buf )).len), (const char *) ((jambuf_as_shunk(buf)).ptr)); } } }; | |||
153 | ||||
154 | entry->older = NULL((void*)0); /* detach from list */ | |||
155 | entry->newer = NULL((void*)0); | |||
156 | ||||
157 | newer->older = older; /* seal the rift */ | |||
158 | older->newer = newer; | |||
159 | ||||
160 | if (older == newer) { | |||
161 | DBGF(DBG_TMI, "%s: empty", entry->info->name){ if ((cur_debugging & (((lset_t)1 << (DBG_TMI_IX)) ))) { DBG_log("%s: empty", entry->info->name); } }; | |||
162 | } else { | |||
163 | log_entry("updated older", older); | |||
164 | log_entry("updated newer ", newer); | |||
165 | } | |||
166 | } |