diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-18 15:06:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-14 15:25:16 -0400 |
commit | 965549aa07d94a9f9e510cdb7a215bf9a3ed7bb8 (patch) | |
tree | 4a8a4fa21a4fba053eade245a341c39ed9c29a1d /src/core/or/scheduler_kist.c | |
parent | 7ace8d5a61f75fb77e3619deed417edd5610a4f1 (diff) | |
download | tor-965549aa07d94a9f9e510cdb7a215bf9a3ed7bb8.tar.gz tor-965549aa07d94a9f9e510cdb7a215bf9a3ed7bb8.zip |
Use assertions so GCC LTO doesn't worry about TLS channel conversion
Part of #27772
Diffstat (limited to 'src/core/or/scheduler_kist.c')
-rw-r--r-- | src/core/or/scheduler_kist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/or/scheduler_kist.c b/src/core/or/scheduler_kist.c index 41c346ac71..f112ea6357 100644 --- a/src/core/or/scheduler_kist.c +++ b/src/core/or/scheduler_kist.c @@ -116,6 +116,7 @@ static unsigned int kist_lite_mode = 1; static inline size_t channel_outbuf_length(channel_t *chan) { + tor_assert(chan); /* In theory, this can not happen because we can not scheduler a channel * without a connection that has its outbuf initialized. Just in case, bug * on this so we can understand a bit more why it happened. */ @@ -194,6 +195,8 @@ update_socket_info_impl, (socket_table_ent_t *ent)) { #ifdef HAVE_KIST_SUPPORT int64_t tcp_space, extra_space; + tor_assert(ent); + tor_assert(ent->chan); const tor_socket_t sock = TO_CONN(BASE_CHAN_TO_TLS((channel_t *) ent->chan)->conn)->s; struct tcp_info tcp; @@ -451,6 +454,7 @@ MOCK_IMPL(int, channel_should_write_to_kernel, * kernel */ MOCK_IMPL(void, channel_write_to_kernel, (channel_t *chan)) { + tor_assert(chan); log_debug(LD_SCHED, "Writing %lu bytes to kernel for chan %" PRIu64, (unsigned long)channel_outbuf_length(chan), chan->global_identifier); |