diff options
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 5580bd0394..44f0566596 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1116,16 +1116,20 @@ assert_circuit_ok(const circuit_t *c) edge_connection_t *conn; const or_circuit_t *or_circ = NULL; const origin_circuit_t *origin_circ = NULL; + circuit_t *nonconst_circ; tor_assert(c); tor_assert(c->magic == ORIGIN_CIRCUIT_MAGIC || c->magic == OR_CIRCUIT_MAGIC); tor_assert(c->purpose >= _CIRCUIT_PURPOSE_MIN && c->purpose <= _CIRCUIT_PURPOSE_MAX); + /* Having a separate variable for this pleases GCC 4.2 in ways I hop I never + * understand. -NM. */ + nonconst_circ = (circuit_t*) c; if (CIRCUIT_IS_ORIGIN(c)) - origin_circ = TO_ORIGIN_CIRCUIT((circuit_t*)c); + origin_circ = TO_ORIGIN_CIRCUIT(nonconst_circ); else - or_circ = TO_OR_CIRCUIT((circuit_t*)c); + or_circ = TO_OR_CIRCUIT(nonconst_circ); if (c->n_conn) { tor_assert(!memcmp(c->n_conn->identity_digest, c->n_conn_id_digest, |