diff options
author | Damien George <damien@micropython.org> | 2022-06-28 16:31:43 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-06-28 16:35:01 +1000 |
commit | 6e83bb47ebeed8f8334925755bed5fea5b3f2475 (patch) | |
tree | c5be9afafe8dbce5ed51829571b18259f1c38a5f /py/builtinhelp.c | |
parent | e024a4c59cb4af6a8d05104df161c61702c2ce4b (diff) |
py/builtinhelp: Don't show help for an MP_MODULE_ATTR_DELEGATION_ENTRY.
Otherwise it can lead to a crash.
Fixes issue #8816.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/builtinhelp.c')
-rw-r--r-- | py/builtinhelp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 84d69caf3..94f8beaff 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -149,8 +149,14 @@ STATIC void mp_help_print_obj(const mp_obj_t obj) { } if (map != NULL) { for (uint i = 0; i < map->alloc; i++) { - if (map->table[i].key != MP_OBJ_NULL) { - mp_help_print_info_about_object(map->table[i].key, map->table[i].value); + mp_obj_t key = map->table[i].key; + if (key != MP_OBJ_NULL + #if MICROPY_MODULE_ATTR_DELEGATION + // MP_MODULE_ATTR_DELEGATION_ENTRY entries have MP_QSTRnull as qstr key. + && key != MP_OBJ_NEW_QSTR(MP_QSTRnull) + #endif + ) { + mp_help_print_info_about_object(key, map->table[i].value); } } } |