MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / safe_add

Function safe_add

src/util/math_util.c:12–20  ·  view source on GitHub ↗

computes x + y returns to true if x+y overflowed

Source from the content-addressed store, hash-verified

10// computes x + y
11// returns to true if x+y overflowed
12bool safe_add
13(
14 int x, // x
15 int y, // y
16 int *z // x+y
17) {
18 ASSERT(z != NULL);
19 return __builtin_add_overflow(x, y, z);
20}
21
22// computes x * y
23// returns to true if x*y overflowed

Callers 1

AR_JOINFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected