py/mpprint: Fix printing pointers with upper bit set.
On a build like nanbox, `mp_uint_t` is wider than `u/intptr_t`. Using a signed type for fetching pointer values resulted in erroneous results: like `<function f at 0xfffffffff7a60bc0>` instead of `<function f at 0xf7a60bc0>`. Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
committed by
Damien George
parent
87b7a9d734
commit
ab620f4084
@@ -530,7 +530,7 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
|
|||||||
char fmt_chr = *fmt;
|
char fmt_chr = *fmt;
|
||||||
mp_uint_t val;
|
mp_uint_t val;
|
||||||
if (fmt_chr == 'p' || fmt_chr == 'P') {
|
if (fmt_chr == 'p' || fmt_chr == 'P') {
|
||||||
val = va_arg(args, intptr_t);
|
val = va_arg(args, uintptr_t);
|
||||||
}
|
}
|
||||||
#if SUPPORT_LL_FORMAT
|
#if SUPPORT_LL_FORMAT
|
||||||
else if (long_long_arg) {
|
else if (long_long_arg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user