summaryrefslogtreecommitdiff
path: root/allchblk.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2008-03-10 17:16:40 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:42 +0200
commit1aca140c127cf0c8b1199eb0149437e61c4b390c (patch)
treee72c4923d754061815f647a9b1861e2fcc7d9861 /allchblk.c
parent8a3f5b962695e29451e96265f1c2bd572d992f16 (diff)
2008-03-10 Hans Boehm <Hans.Boehm@hp.com>
* allchblk.c (GC_allochblk): Check for overflow during size rounding. * tests/huge_test.c: New. * Makefile.direct, tests/tests.am: Add huge_test.c * Makefile.in: Regenerate.
Diffstat (limited to 'allchblk.c')
-rw-r--r--allchblk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/allchblk.c b/allchblk.c
index 8d326e5..9347b67 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -587,6 +587,9 @@ GC_allochblk(size_t sz, int kind, unsigned flags/* IGNORE_OFF_PAGE or 0 */)
GC_ASSERT((sz & (GRANULE_BYTES - 1)) == 0);
blocks = OBJ_SZ_TO_BLOCKS(sz);
+ if ((signed_word)(blocks * HBLKSIZE) < 0) {
+ return 0;
+ }
start_list = GC_hblk_fl_from_blocks(blocks);
/* Try for an exact match first. */
result = GC_allochblk_nth(sz, kind, flags, start_list, FALSE);