summaryrefslogtreecommitdiff
path: root/py/objexcept.c
diff options
context:
space:
mode:
authorTom Collins <tom.collins@digi.com>2019-03-01 19:57:07 -0500
committerDamien George <damien.p.george@gmail.com>2019-03-04 12:07:03 +1100
commit2d644ac45530bac21785fddbd9efa3466204ff26 (patch)
treebb7fbffd92b070a88a36904b86cb0c1e378f6107 /py/objexcept.c
parentf8f2724297b2c3e87e074feddfac26f3ce46ae92 (diff)
py/objexcept: Fix hash of exc str created in mp_obj_new_exception_msg.
Diffstat (limited to 'py/objexcept.c')
-rw-r--r--py/objexcept.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objexcept.c b/py/objexcept.c
index 5899b3427..d9258f9b5 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -348,9 +348,9 @@ mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg
// Create the string object and call mp_obj_exception_make_new to create the exception
o_str->base.type = &mp_type_str;
- o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
o_str->len = strlen(msg);
o_str->data = (const byte*)msg;
+ o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
mp_obj_t arg = MP_OBJ_FROM_PTR(o_str);
return mp_obj_exception_make_new(exc_type, 1, 0, &arg);
}