Don't long live class attributes

When they are added later, they are also referenced in the main
dictionary.

Fixes #1218
This commit is contained in:
Scott Shawcroft 2019-02-01 16:04:16 -08:00
parent 3af57f3e92
commit a39fc94dde
No known key found for this signature in database
GPG Key ID: FD0EDC4B6C53CA59
1 changed files with 1 additions and 1 deletions

View File

@ -1065,7 +1065,7 @@ STATIC void type_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
// store attribute
mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND);
elem->value = make_obj_long_lived(dest[1], 10);
elem->value = dest[1];
dest[0] = MP_OBJ_NULL; // indicate success
}
}