unix/main: Don't allow to specify too small heap size.

This will lead to crash like:

FATAL: uncaught NLR 80a5420

On x86_32, the minimum heap size is smaller, but not 2 times, so just
use value which works for x86_64.
pull/1/head
Paul Sokolovsky 2017-05-06 11:40:20 +03:00
parent 0986675451
commit c1e0eb7afe
1 changed files with 4 additions and 0 deletions

View File

@ -375,6 +375,10 @@ STATIC void pre_process_options(int argc, char **argv) {
if (word_adjust) {
heap_size = heap_size * BYTES_PER_WORD / 4;
}
// If requested size too small, we'll crash anyway
if (heap_size < 700) {
goto invalid_arg;
}
#endif
} else {
invalid_arg: