From e9c086aaac1a68a03a711d12058cd42673fcd1cd Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 30 Jul 2015 18:58:11 -0400 Subject: [PATCH] =?UTF-8?q?Added=20assert.=20Thanks=20to=20Jean-Pierre=20M?= =?UTF-8?q?=C3=BCnch=20for=20the=20suggestion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- misc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc.h b/misc.h index 7a93ef98..f0df03c2 100644 --- a/misc.h +++ b/misc.h @@ -379,8 +379,10 @@ template inline bool SafeConvert(T1 from, T2 &to) { to = (T2)from; - if (from != to || (from > 0) != (to > 0)) - return false; + if (from != to || (from > 0) != (to > 0)) { + CRYPTOPP_ASSERT(false); return false; + } + return true; }