Add some assertions to ensure that arrays of correct size are used in MC

This commit is contained in:
Mael Rouxel-Labbé 2024-02-29 10:53:37 +01:00
parent 33c0079e85
commit 49cb69fae7
2 changed files with 6 additions and 0 deletions

View File

@ -226,6 +226,9 @@ void triangles_to_polygon_soup(const TriangleRange& triangles,
// simply use increasing indices
polygons.push_back({id + 2, id + 1, id + 0});
// just a safeguard against arrays of the wrong size
CGAL_assertion(polygons.back().size() == 3);
}
#ifdef CGAL_LINKED_WITH_TBB

View File

@ -198,6 +198,9 @@ public:
points.insert(points.begin(), m_points.begin(), m_points.end());
for (const auto& tri : m_triangles) {
triangles.push_back({ tri[0], tri[1], tri[2] });
// just a safeguard against arrays of the wrong size
CGAL_assertion(triangles.back().size() == 3);
}
}