summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.c b/main.c
index c60cded16..c05157e86 100755
--- a/main.c
+++ b/main.c
@@ -105,12 +105,18 @@ void start_mp(supervisor_allocation* heap) {
// Stack limit should be less than real stack size, so we have a chance
// to recover from limit hit. (Limit is measured in bytes.)
mp_stack_ctrl_init();
- mp_stack_set_limit(stack_alloc->length - 1024);
+
+ if (stack_alloc != NULL) {
+ mp_stack_set_limit(stack_alloc->length - 1024);
+ }
+
#if MICROPY_MAX_STACK_USAGE
// _ezero (same as _ebss) is an int, so start 4 bytes above it.
- mp_stack_set_bottom(stack_alloc->ptr);
- mp_stack_fill_with_sentinel();
+ if (stack_alloc != NULL) {
+ mp_stack_set_bottom(stack_alloc->ptr);
+ mp_stack_fill_with_sentinel();
+ }
#endif
// Sync the file systems in case any used RAM from the GC to cache. As soon