py: Rename MP_QSTR_NULL to MP_QSTRnull to avoid intern collisions.

Fixes #5140.
This commit is contained in:
Josh Lloyd
2019-09-25 17:53:30 +12:00
committed by Damien George
parent b596638b9b
commit 7d58a197cf
16 changed files with 31 additions and 23 deletions

View File

@@ -169,7 +169,7 @@ mp_obj_t mp_obj_str_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
// Check if a qstr with this data already exists
qstr q = qstr_find_strn((const char*)str_data, str_len);
if (q != MP_QSTR_NULL) {
if (q != MP_QSTRnull) {
return MP_OBJ_NEW_QSTR(q);
}
@@ -2042,7 +2042,7 @@ mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr) {
// if not a bytes object, look if a qstr with this data already exists
if (type == &mp_type_str) {
qstr q = qstr_find_strn(vstr->buf, vstr->len);
if (q != MP_QSTR_NULL) {
if (q != MP_QSTRnull) {
vstr_clear(vstr);
vstr->alloc = 0;
return MP_OBJ_NEW_QSTR(q);
@@ -2067,7 +2067,7 @@ mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr) {
mp_obj_t mp_obj_new_str(const char* data, size_t len) {
qstr q = qstr_find_strn(data, len);
if (q != MP_QSTR_NULL) {
if (q != MP_QSTRnull) {
// qstr with this data already exists
return MP_OBJ_NEW_QSTR(q);
} else {