Skip to content

Commit c1e0eb7

Browse files
committed
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.
1 parent 0986675 commit c1e0eb7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

unix/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ STATIC void pre_process_options(int argc, char **argv) {
375375
if (word_adjust) {
376376
heap_size = heap_size * BYTES_PER_WORD / 4;
377377
}
378+
// If requested size too small, we'll crash anyway
379+
if (heap_size < 700) {
380+
goto invalid_arg;
381+
}
378382
#endif
379383
} else {
380384
invalid_arg:

0 commit comments

Comments
 (0)