segfault in Array.append in rare case

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13113 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2012-12-06 15:39:30 +00:00
parent c8273a179c
commit 19e086795e
1 changed files with 4 additions and 3 deletions

View File

@ -319,12 +319,13 @@ static value caml_array_gather(intnat num_arrays,
count--, src++, pos++) {
caml_initialize(&Field(res, pos), *src);
}
}
Assert(pos == size);
/* Many caml_initialize in a row can create a lot of old-to-young
refs. Give the minor GC a chance to run if it needs to. */
res = caml_check_urgent_gc(res);
}
Assert(pos == size);
}
CAMLreturn (res);
}