diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-10 13:40:46 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-10 13:40:46 +0100 |
commit | ccc85ea0da8433d782bdec79cf09ccd242017198 (patch) | |
tree | 418fdefc28e9b89f81160029c8057dc5d4003fda /py/objfun.c | |
parent | 04b7cc4df0a4fe7a6d5ec1e756baac2424b26922 (diff) |
py: Combine native emitters to 1 glue function; distinguish viper.
This patch simplifies the glue between native emitter and runtime,
and handles viper code like inline assember: return values are
converted to Python objects.
Fixes issue #531.
Diffstat (limited to 'py/objfun.c')
-rw-r--r-- | py/objfun.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/py/objfun.c b/py/objfun.c index f5fbf9580..8994486c8 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -506,12 +506,7 @@ STATIC mp_obj_t convert_val_from_inline_asm(machine_uint_t val) { STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { mp_obj_fun_asm_t *self = self_in; - if (n_args != self->n_args) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "function takes %d positional arguments but %d were given", self->n_args, n_args)); - } - if (n_kw != 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "function does not take keyword arguments")); - } + mp_arg_check_num(n_args, n_kw, self->n_args, self->n_args, false); machine_uint_t ret; if (n_args == 0) { |