diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-16 00:40:23 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-16 00:42:56 +0200 |
commit | ff4678c5b4069308b98df9c786502b93f25b8a4e (patch) | |
tree | fda780b7a42fadd3a390c8761470ec98c473f75d /py | |
parent | 36109d246fc5396c38bedfc240ddbe60a3c718fc (diff) | |
download | micropython-ff4678c5b4069308b98df9c786502b93f25b8a4e.tar.gz micropython-ff4678c5b4069308b98df9c786502b93f25b8a4e.zip |
objexcept: Fix thinko with args to mp_obj_new_list().
First arg is not alloc size, but real size, so if used as
mp_obj_new_list(3, NULL), need to store items, not append.
Diffstat (limited to 'py')
-rw-r--r-- | py/objexcept.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objexcept.c b/py/objexcept.c index dbe702fa9e..fd51818d52 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -162,7 +162,7 @@ void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, machine_uint_t // for traceback, we are just using the list object for convenience, it's not really a list of Python objects if (self->traceback == MP_OBJ_NULL) { - self->traceback = mp_obj_new_list(3, NULL); + self->traceback = mp_obj_new_list(0, NULL); } mp_obj_list_append(self->traceback, (mp_obj_t)(machine_uint_t)file); mp_obj_list_append(self->traceback, (mp_obj_t)(machine_uint_t)line); |