summaryrefslogtreecommitdiffstatshomepage
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-01 17:51:47 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-01 17:51:47 +0000
commit87413a4d0c579ec491cf52ab8d6520430df64c7d (patch)
treec19abcbf9275c5debd4436ed5146a4aab1ad4c7d /py/runtime.c
parent382b3d00ed9a2f31dcedbf65ce82cbada9b6dbdf (diff)
parent90750029df8d7fd24600cc4fe4c98a5b80731f28 (diff)
downloadmicropython-87413a4d0c579ec491cf52ab8d6520430df64c7d.tar.gz
micropython-87413a4d0c579ec491cf52ab8d6520430df64c7d.zip
Merge branch 'fun-defargs' of github.com:pfalcon/micropython into pfalcon-fun-defargs
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/runtime.c b/py/runtime.c
index ee8d720c22..77e596c5d0 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -674,7 +674,7 @@ mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
return mp_const_none;
}
-mp_obj_t rt_make_function_from_id(int unique_code_id) {
+mp_obj_t rt_make_function_from_id(int unique_code_id, mp_obj_t def_args) {
DEBUG_OP_printf("make_function_from_id %d\n", unique_code_id);
if (unique_code_id < 1 || unique_code_id >= next_unique_code_id) {
// illegal code id
@@ -686,7 +686,7 @@ mp_obj_t rt_make_function_from_id(int unique_code_id) {
mp_obj_t fun;
switch (c->kind) {
case MP_CODE_BYTE:
- fun = mp_obj_new_fun_bc(c->n_args, c->n_state, c->u_byte.code);
+ fun = mp_obj_new_fun_bc(c->n_args, def_args, c->n_state, c->u_byte.code);
break;
case MP_CODE_NATIVE:
fun = rt_make_function_n(c->n_args, c->u_native.fun);
@@ -710,7 +710,7 @@ mp_obj_t rt_make_function_from_id(int unique_code_id) {
mp_obj_t rt_make_closure_from_id(int unique_code_id, mp_obj_t closure_tuple) {
DEBUG_OP_printf("make_closure_from_id %d\n", unique_code_id);
// make function object
- mp_obj_t ffun = rt_make_function_from_id(unique_code_id);
+ mp_obj_t ffun = rt_make_function_from_id(unique_code_id, MP_OBJ_NULL);
// wrap function in closure object
return mp_obj_new_closure(ffun, closure_tuple);
}