py/objcell: Fix printing of cell ID/pointer.
On the nanbox build, `o->obj` is a 64-bit type but `%p` formats a 32-bit type, leading to undefined behavior. Print the cell's ID as a hex integer instead. This location was found using an experimental gcc plugin for `mp_printf` error checking. Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
committed by
Damien George
parent
4495610f8d
commit
ee4f27affa
@@ -30,7 +30,7 @@
|
|||||||
static void cell_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
|
static void cell_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
|
||||||
(void)kind;
|
(void)kind;
|
||||||
mp_obj_cell_t *o = MP_OBJ_TO_PTR(o_in);
|
mp_obj_cell_t *o = MP_OBJ_TO_PTR(o_in);
|
||||||
mp_printf(print, "<cell %p ", o->obj);
|
mp_printf(print, "<cell " HEX_FMT " ", (mp_uint_t)o->obj);
|
||||||
if (o->obj == MP_OBJ_NULL) {
|
if (o->obj == MP_OBJ_NULL) {
|
||||||
mp_print_str(print, "(nil)");
|
mp_print_str(print, "(nil)");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user