aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/scriptnum_ops.cpp
diff options
context:
space:
mode:
authorpierrenn <git@pnn.sh>2020-04-08 15:10:28 +0900
committerpierrenn <git@pnn.sh>2020-04-09 08:32:00 +0900
commit2748e8793267126c5b40621d75d1930e358f057e (patch)
tree2c60aea1c57f44cab3b835ed33b3ccae2e40b950 /src/test/fuzz/scriptnum_ops.cpp
parent1b151e3ffce7c1a2ee46bf280cc1d96775d1f91e (diff)
script: prevent UB when computing abs value for num opcode serialize
Diffstat (limited to 'src/test/fuzz/scriptnum_ops.cpp')
-rw-r--r--src/test/fuzz/scriptnum_ops.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/test/fuzz/scriptnum_ops.cpp b/src/test/fuzz/scriptnum_ops.cpp
index 42b1432f13..f4e079fb89 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<uint8_t>& 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<int64_t>::min()}) {
- (void)script_num.getvch();
- }
+ (void)script_num.getvch();
}
}