summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-10-22 23:45:37 +0100
committerDamien George <damien.p.george@gmail.com>2015-11-13 12:49:18 +0000
commit3a3db4dcf0400cffef860f61a84979cb1f7a7541 (patch)
treecfdcb6931cb120f2f993e10e7db6dc14f40b1ded /py/compile.c
parent9b7f583b0ca37ee87e5fb82e2d65fcd96a609b2f (diff)
py: Put all bytecode state (arg count, etc) in bytecode.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c
index f10b37807..e0561e6c3 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -539,6 +539,12 @@ STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int
assert(n_pos_defaults >= 0);
assert(n_kw_defaults >= 0);
+ // set flags
+ if (n_kw_defaults > 0) {
+ this_scope->scope_flags |= MP_SCOPE_FLAG_DEFKWARGS;
+ }
+ this_scope->num_def_pos_args = n_pos_defaults;
+
// make closed over variables, if any
// ensure they are closed over in the order defined in the outer scope (mainly to agree with CPython)
int nfree = 0;