MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / AddInt63Overflow

Function AddInt63Overflow

src/script/intmath.cpp:27–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool AddInt63Overflow(int64_t a, int64_t b, int64_t &result) {
28#if HAVE_DECL___BUILTIN_SADDLL_OVERFLOW
29 if (__builtin_saddll_overflow(a, b, (long long int *)&result)) {
30 return true;
31 }
32 return result == std::numeric_limits<int64_t>::min();
33#else
34 return AddInt63OverflowEmulated(a, b, result);
35#endif
36}
37
38bool SubInt63OverflowEmulated(int64_t a, int64_t b, int64_t &result) {
39 if (a < 0 && b > std::numeric_limits<int64_t>::max() + a) {

Callers 2

operator+Method · 0.85
CheckArithmeticFunction · 0.85

Calls 1

AddInt63OverflowEmulatedFunction · 0.85

Tested by 1

CheckArithmeticFunction · 0.68