From eb11bd1addd8a197d535f4f60b5c23f5e533b3dd Mon Sep 17 00:00:00 2001 From: soarex Date: Mon, 9 Jan 2023 02:47:24 +0300 Subject: [PATCH] Fix incorrect handling of mmap error --- runtime/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/runtime.c b/runtime/runtime.c index 40a959ea4..c76981712 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -1885,7 +1885,7 @@ extern void __init (void) { from_space.begin = mmap (NULL, space_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0); to_space.begin = NULL; - if (to_space.begin == MAP_FAILED) { + if (from_space.begin == MAP_FAILED) { perror ("EROOR: init_pool: mmap failed\n"); exit (1); }