From b2381d0513e3ec9a874643b7faf7afeb4490a1e7 Mon Sep 17 00:00:00 2001 From: frsyuki Date: Wed, 19 Aug 2009 15:10:10 +0900 Subject: [PATCH] cpp: fix overflow check for minimum number of signed integer type --- cpp/type/int.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/type/int.hpp b/cpp/type/int.hpp index 8fdc3866..03500f76 100644 --- a/cpp/type/int.hpp +++ b/cpp/type/int.hpp @@ -37,7 +37,7 @@ namespace detail { { throw type_error(); } return o.via.u64; } else if(o.type == type::NEGATIVE_INTEGER) { - if(o.via.i64 < (int64_t)-std::numeric_limits::max()) + if(o.via.i64 < (int64_t)std::numeric_limits::min()) { throw type_error(); } return o.via.i64; }