summaryrefslogtreecommitdiff
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-03-30 11:09:00 +1100
committerDamien George <damien.p.george@gmail.com>2018-03-30 11:13:32 +1100
commit32807881954f106b9735de74fe984062a0815b81 (patch)
tree191a534e36c54c7c26005864045996fc87f6abb8 /py/obj.h
parentbc3a5f191714f28bef95d9f87c24f7367c90d54a (diff)
py/runtime: Check that keys in dicts passed as ** args are strings.
Prior to this patch the code would crash if a key in a ** dict was anything other than a str or qstr. This is because mp_setup_code_state() assumes that keys in kwargs are qstrs (for efficiency). Thanks to @jepler for finding the bug.
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/obj.h b/py/obj.h
index 2779b3f86..80599966e 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -720,6 +720,7 @@ qstr mp_obj_str_get_qstr(mp_obj_t self_in); // use this if you will anyway conve
const char *mp_obj_str_get_str(mp_obj_t self_in); // use this only if you need the string to be null terminated
const char *mp_obj_str_get_data(mp_obj_t self_in, size_t *len);
mp_obj_t mp_obj_str_intern(mp_obj_t str);
+mp_obj_t mp_obj_str_intern_checked(mp_obj_t obj);
void mp_str_print_quoted(const mp_print_t *print, const byte *str_data, size_t str_len, bool is_bytes);
#if MICROPY_PY_BUILTINS_FLOAT