]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()
authorOndřej Surý <ondrej@isc.org>
Mon, 28 Mar 2022 10:59:43 +0000 (12:59 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 28 Mar 2022 21:26:08 +0000 (23:26 +0200)
In couple places, we have missed INSIST(0) or ISC_UNREACHABLE()
replacement on some branches with UNREACHABLE().  Replace all
ISC_UNREACHABLE() or INSIST(0) calls with UNREACHABLE().

bin/tests/test_client.c
bin/tests/test_server.c
cocci/unreachable.spatch
lib/dns/rpz.c
lib/isc/netmgr/netmgr.c
lib/isc/rwlock.c
lib/isc/timer.c
lib/ns/query.c

index 10517f24c7b6b5e17fe21f5ebb6e255466a5e0bc..edc6d66320f09cdc325ca6a07feaec6274c992a8 100644 (file)
@@ -232,7 +232,7 @@ parse_options(int argc, char **argv) {
                        break;
 
                default:
-                       INSIST(0);
+                       UNREACHABLE();
                }
        }
 
index 066dcf9e7ffa2d01da681e42c03c47e026831844..2d80db4457116d5e685d9cc9936b90482b710886 100644 (file)
@@ -152,7 +152,7 @@ parse_options(int argc, char **argv) {
                        break;
 
                default:
-                       INSIST(0);
+                       UNREACHABLE();
                }
        }
 
index 100f1a0abe16839dc8ab9846a097b474150ed56a..84c0c344bb5f9af56f75fd8c6790a505d1a8fb20 100644 (file)
@@ -11,3 +11,9 @@
 -   INSIST(0);
 -   ISC_UNREACHABLE();
 +   UNREACHABLE();
+
+@@
+@@
+
+- UNREACHABLE();
+  UNREACHABLE();
index 4fa7501e32d9454396d6ba8ab496a77e8e83032a..aa611d7c730fb710fefa5d59ad950c727d9d0b92 100644 (file)
@@ -2590,7 +2590,7 @@ dns_rpz_find_ip(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type,
                        zbits &= have.nsipv4;
                        break;
                default:
-                       INSIST(0);
+                       UNREACHABLE();
                        break;
                }
        } else if (netaddr->family == AF_INET6) {
@@ -2616,7 +2616,7 @@ dns_rpz_find_ip(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type,
                        zbits &= have.nsipv6;
                        break;
                default:
-                       INSIST(0);
+                       UNREACHABLE();
                        break;
                }
        } else {
index 2bce1c7d7caa13147ff920eb5a9c18d33ea2c565..17d20046855f47703ad27f57f2bcd460a7508077 100644 (file)
@@ -2273,7 +2273,7 @@ isc__nm_process_sock_buffer(isc_nmsocket_t *sock) {
                        }
                        break;
                default:
-                       INSIST(0);
+                       UNREACHABLE();
                }
        }
 }
@@ -2799,7 +2799,6 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) {
                REQUIRE(sock->parent == NULL);
                break;
        default:
-               INSIST(0);
                UNREACHABLE();
                break;
        }
@@ -3493,7 +3492,6 @@ isc_nm_set_maxage(isc_nmhandle_t *handle, const uint32_t ttl) {
        case isc_nm_tlssocket:
 #endif /* HAVE_LIBNGHTTP2 */
        default:
-               INSIST(0);
                UNREACHABLE();
                break;
        }
index c76ea74dda342418b677dad816d0e7eff0774528..2691a44de440f27b07c9b908cc7b6b4395a020fd 100644 (file)
@@ -82,7 +82,7 @@ isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
                }
                break;
        default:
-               INSIST(0);
+               UNREACHABLE();
        }
 
        switch (ret) {
index f833000601f6c4059feb22cbe3e6eed7167093c4..5d54e3843a553b050c959596f04c73a2b57b9520 100644 (file)
@@ -117,7 +117,6 @@ schedule(isc_timer_t *timer, isc_time_t *now, bool signal_ok) {
                due = timer->idle;
                break;
        default:
-               INSIST(0);
                UNREACHABLE();
        }
 
@@ -425,7 +424,6 @@ dispatch(isc_timermgr_t *manager, isc_time_t *now) {
                        need_schedule = false;
                        break;
                default:
-                       INSIST(0);
                        UNREACHABLE();
                }
 
index cb1a579307fa8821b0f248a7984d1700d4782475..b9e76eb8971ee5b0e67bd13871dc80cb76a341cd 100644 (file)
@@ -293,7 +293,7 @@ get_hooktab(query_ctx_t *qctx) {
                                result = _res;                      \
                                goto cleanup;                       \
                        default:                                    \
-                               INSIST(0);                          \
+                               UNREACHABLE();                      \
                        }                                           \
                }                                                   \
        } while (false)