Skip to content

Commit aa63684

Browse files
authored
Merge pull request #903 from jepler/stack-overflow-crash
main: Explicitly set the stack top based on _estack
2 parents 74ced17 + a4e06bd commit aa63684

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int __attribute__((used)) main(void) {
241241

242242
// Stack limit should be less than real stack size, so we have a chance
243243
// to recover from limit hit. (Limit is measured in bytes.)
244-
mp_stack_ctrl_init();
244+
mp_stack_set_top((char*)&_estack);
245245
mp_stack_set_limit((char*)&_estack - (char*)&_ebss - 1024);
246246

247247
#if MICROPY_MAX_STACK_USAGE

0 commit comments

Comments
 (0)