diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-10 17:22:19 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-10 17:22:19 +0000 |
commit | 069a35e3a56bc68571470c91d919f013d4b40650 (patch) | |
tree | 47c28b4c59e5929a93b21a0c836ae19e9a2d91e8 /py/emitbc.c | |
parent | 190d1ba297621b7a266fdde8968d163fd5018f2f (diff) | |
download | micropython-069a35e3a56bc68571470c91d919f013d4b40650.tar.gz micropython-069a35e3a56bc68571470c91d919f013d4b40650.zip |
py, compiler: Improve stack depth counting.
Much less of a hack now. Hopefully it's correct!
Diffstat (limited to 'py/emitbc.c')
-rw-r--r-- | py/emitbc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/emitbc.c b/py/emitbc.c index 74f324176e..b8a47ec45e 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -288,11 +288,11 @@ STATIC void emit_bc_end_pass(emit_t *emit) { } } -bool emit_bc_last_emit_was_return_value(emit_t *emit) { +STATIC bool emit_bc_last_emit_was_return_value(emit_t *emit) { return emit->last_emit_was_return_value; } -int emit_bc_get_stack_size(emit_t *emit) { +STATIC int emit_bc_get_stack_size(emit_t *emit) { return emit->stack_size; } @@ -608,12 +608,12 @@ STATIC void emit_bc_with_cleanup(emit_t *emit) { } STATIC void emit_bc_setup_except(emit_t *emit, uint label) { - emit_bc_pre(emit, 6); + emit_bc_pre(emit, 0); emit_write_byte_code_byte_unsigned_label(emit, MP_BC_SETUP_EXCEPT, label); } STATIC void emit_bc_setup_finally(emit_t *emit, uint label) { - emit_bc_pre(emit, 6); + emit_bc_pre(emit, 0); emit_write_byte_code_byte_unsigned_label(emit, MP_BC_SETUP_FINALLY, label); } |