From 5c0633f17a4452575c9bc2f7b4208220bbebd279 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 21 Jan 2018 16:50:35 +0300 Subject: [PATCH] Replace assert with if to prevent warning about unused variable. GitOrigin-RevId: f9e72c623ace83f14b2268647a0880bcb49040a4 --- memprof/memprof.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memprof/memprof.cpp b/memprof/memprof.cpp index da75c5ed..11822ee0 100644 --- a/memprof/memprof.cpp +++ b/memprof/memprof.cpp @@ -175,7 +175,10 @@ std::int32_t get_ht_pos(const Backtrace &bt, bool force = false) { pos++; if (pos == static_cast(ht.size())) { pos = 0; - assert(!was_overflow); + if (was_overflow) { + // unreachable + std::abort(); + } was_overflow = true; } }