Skip to content

Commit

Permalink
Assert size overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbs96 committed Nov 19, 2023
1 parent 57b0f81 commit f7402d3
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ template <typename N> class PathSensitivityManagerBase {
// WLInsert. This way, we can stop the process, when we have reached the
// MaxDepth

auto NumBytes =
(sizeof(vertex_t) + 2 * sizeof(std::pair<vertex_t, vertex_t>)) *
EquivSize;
constexpr auto Factor =
sizeof(vertex_t) + 2 * sizeof(std::pair<vertex_t, vertex_t>);
assert(EquivSize <= SIZE_MAX / Factor && "Overflow on size calculation");
auto NumBytes = Factor * EquivSize;

// For performance reasons, we wish to allocate the buffer on the stack, if
// it is small enough
Expand Down

0 comments on commit f7402d3

Please sign in to comment.