summaryrefslogtreecommitdiff
path: root/py/objfun.c
diff options
context:
space:
mode:
authorTom Collins <tom.collins@digi.com>2018-05-16 17:08:34 -0700
committerDamien George <damien.p.george@gmail.com>2018-05-17 11:20:06 +1000
commita883fe12d95953e9aa705f0050da1b61ae54ec8d (patch)
tree98c6d8c9f11d7d41f79b9477f7d6e22768aafb6e /py/objfun.c
parent1b7487e519c2e2a66f2f5a45ebd238d0773ca3d3 (diff)
py/objfun: Fix variable name in DECODE_CODESTATE_SIZE() macro.
This patch fixes the macro so you can pass any name in, and the macro will make more sense if you're reading it on its own. It worked previously because n_state is always passed in as n_state_out_var.
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/objfun.c b/py/objfun.c
index e6d33d287..8c51d92e0 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -204,10 +204,11 @@ STATIC void dump_args(const mp_obj_t *a, size_t sz) {
n_state_out_var = mp_decode_uint_value(bytecode); \
size_t n_exc_stack = mp_decode_uint_value(mp_decode_uint_skip(bytecode)); \
\
- n_state += VM_DETECT_STACK_OVERFLOW; \
+ n_state_out_var += VM_DETECT_STACK_OVERFLOW; \
\
/* state size in bytes */ \
- state_size_out_var = n_state * sizeof(mp_obj_t) + n_exc_stack * sizeof(mp_exc_stack_t); \
+ state_size_out_var = n_state_out_var * sizeof(mp_obj_t) \
+ + n_exc_stack * sizeof(mp_exc_stack_t); \
}
#define INIT_CODESTATE(code_state, _fun_bc, n_args, n_kw, args) \