From 2748e8793267126c5b40621d75d1930e358f057e Mon Sep 17 00:00:00 2001 From: pierrenn Date: Wed, 8 Apr 2020 15:10:28 +0900 Subject: script: prevent UB when computing abs value for num opcode serialize --- src/test/fuzz/integer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/test/fuzz/integer.cpp') diff --git a/src/test/fuzz/integer.cpp b/src/test/fuzz/integer.cpp index fff2fabd1..78ecc4766 100644 --- a/src/test/fuzz/integer.cpp +++ b/src/test/fuzz/integer.cpp @@ -135,11 +135,7 @@ void test_one_input(const std::vector& buffer) const CScriptNum script_num{i64}; (void)script_num.getint(); - // Avoid negation failure: - // script/script.h:332:35: runtime error: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself - if (script_num != CScriptNum{std::numeric_limits::min()}) { - (void)script_num.getvch(); - } + (void)script_num.getvch(); const arith_uint256 au256 = UintToArith256(u256); assert(ArithToUint256(au256) == u256); -- cgit v1.2.3