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/scriptnum_ops.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/test/fuzz/scriptnum_ops.cpp') diff --git a/src/test/fuzz/scriptnum_ops.cpp b/src/test/fuzz/scriptnum_ops.cpp index 42b1432f1..f4e079fb8 100644 --- a/src/test/fuzz/scriptnum_ops.cpp +++ b/src/test/fuzz/scriptnum_ops.cpp @@ -129,10 +129,6 @@ void test_one_input(const std::vector& buffer) break; } (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(); } } -- cgit v1.2.3