Continuing in the face of an overflow when calculating rectangle area was sort
of pointless. The test case for #1906 is an example of this, that runs for many
minutes _repeatedly_ detecting overflows in this code before finally erroring
out when trying to do follow on layout with values that make no sense. It is
simpler and cheaper to just error out immediately when this happens.
Gitlab: #1906
#include "config.h"
#include <label/index.h>
-#include <stddef.h>
#include <stdio.h>
#include <assert.h>
#include <limits.h>
+#include <stdlib.h>
#include <common/logic.h>
#include <common/arith.h>
#include <label/rectangle.h>
#include <cgraph/cgraph.h>
+#include <cgraph/exit.h>
#define Undefined(x) ((x)->boundary[0] > (x)->boundary[NUMDIMS])
if (dim == 0) return 0;
if (UINT_MAX / dim < area) {
agerr (AGERR, "label: area too large for rtree\n");
- return UINT_MAX;
+ graphviz_exit(EXIT_FAILURE);
}
area *= dim;
}