fix use of locals_dict

This commit is contained in:
Jeff Epler 2023-09-22 14:25:23 -05:00
parent d1ee906afd
commit 7c2fbff965
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -28,7 +28,7 @@
#include "py/runtime.h" #include "py/runtime.h"
mp_obj_t cp_enum_find(const mp_obj_type_t *type, int value) { mp_obj_t cp_enum_find(const mp_obj_type_t *type, int value) {
const mp_obj_dict_t *dict = type->locals_dict; const mp_obj_dict_t *dict = MP_OBJ_TYPE_GET_SLOT(type, locals_dict);
for (size_t i = 0; i < dict->map.used; i++) { for (size_t i = 0; i < dict->map.used; i++) {
const cp_enum_obj_t *v = MP_OBJ_TO_PTR(dict->map.table[i].value); const cp_enum_obj_t *v = MP_OBJ_TO_PTR(dict->map.table[i].value);
if (v->value == value) { if (v->value == value) {