aboutsummaryrefslogtreecommitdiff
path: root/pk/minit.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/minit.c')
-rw-r--r--pk/minit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pk/minit.c b/pk/minit.c
index 80380f8..fcb2ca9 100644
--- a/pk/minit.c
+++ b/pk/minit.c
@@ -47,6 +47,9 @@ static void memory_init()
if (mem_size == 0)
panic("could not determine memory capacity");
+ if ((intptr_t)mem_size < 0)
+ mem_size = INTPTR_MIN;
+
if (num_harts == 0)
panic("could not determine number of harts");
}