diff options
author | Markus Siemens <siemens1993@gmail.com> | 2014-01-31 22:16:23 +0100 |
---|---|---|
committer | Markus Siemens <siemens1993@gmail.com> | 2014-01-31 22:16:23 +0100 |
commit | 2c2a124e166b9263d027a77fe25d69c11e8003a4 (patch) | |
tree | 9eaf8ae09a60132b88d1b995a217b5a4d288a451 | |
parent | 7ee8e468784480e516d199362ee93a84f42e2594 (diff) | |
download | micropython-2c2a124e166b9263d027a77fe25d69c11e8003a4.tar.gz micropython-2c2a124e166b9263d027a77fe25d69c11e8003a4.zip |
Fix SIGSEV when running "a"()
rt_call_function_n_kw did check for integers but not for strings
being called. Added a check so running "a"() won't SIGSEV but
throw an exception.
-rw-r--r-- | py/runtime.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index ea96ca9f7a..bd0051462d 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -739,6 +739,8 @@ mp_obj_t rt_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp if (MP_OBJ_IS_SMALL_INT(fun_in)) { nlr_jump(mp_obj_new_exception_msg(MP_QSTR_TypeError, "'int' object is not callable")); + } else if(MP_OBJ_IS_STR(fun_in)) { + nlr_jump(mp_obj_new_exception_msg(MP_QSTR_TypeError, "'str' object is not callable")); } else { mp_obj_base_t *fun = fun_in; if (fun->type->call != NULL) { |