Skip to content

Commit cadbd7f

Browse files
committed
py/modmicropython: Cast stack_limit value so it prints correctly.
Without this cast the print will give a wrong result on nan-boxing builds.
1 parent 3235b95 commit cadbd7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py/modmicropython.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args) {
7272
(mp_uint_t)m_get_total_bytes_allocated(), (mp_uint_t)m_get_current_bytes_allocated(), (mp_uint_t)m_get_peak_bytes_allocated());
7373
#endif
7474
#if MICROPY_STACK_CHECK
75-
mp_printf(&mp_plat_print, "stack: " UINT_FMT " out of " INT_FMT "\n", mp_stack_usage(), MP_STATE_THREAD(stack_limit));
75+
mp_printf(&mp_plat_print, "stack: " UINT_FMT " out of " UINT_FMT "\n",
76+
mp_stack_usage(), (mp_uint_t)MP_STATE_THREAD(stack_limit));
7677
#else
7778
mp_printf(&mp_plat_print, "stack: " UINT_FMT "\n", mp_stack_usage());
7879
#endif

0 commit comments

Comments
 (0)