summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-14 21:32:42 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-14 21:32:42 +0000
commitd2d64f00fb7f1487c1fa21a456e003a801d7e711 (patch)
tree7345a9ba92baed508c4287bfca5ab09d67290821 /py/emitbc.c
parent65ef6b768cbba6a55f28c13433c3763c6567045e (diff)
downloadmicropython-d2d64f00fb7f1487c1fa21a456e003a801d7e711.tar.gz
micropython-d2d64f00fb7f1487c1fa21a456e003a801d7e711.zip
py: Add "default" to switches to allow better code flow analysis.
This helps compiler produce smaller code. Saves 124 bytes on stmhal and bare-arm.
Diffstat (limited to 'py/emitbc.c')
-rw-r--r--py/emitbc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/emitbc.c b/py/emitbc.c
index d63739125f..436fdf1430 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -454,8 +454,9 @@ STATIC void emit_bc_load_const_tok(emit_t *emit, mp_token_kind_t tok) {
case MP_TOKEN_KW_FALSE: emit_write_bytecode_byte(emit, MP_BC_LOAD_CONST_FALSE); break;
case MP_TOKEN_KW_NONE: emit_write_bytecode_byte(emit, MP_BC_LOAD_CONST_NONE); break;
case MP_TOKEN_KW_TRUE: emit_write_bytecode_byte(emit, MP_BC_LOAD_CONST_TRUE); break;
+ no_other_choice:
case MP_TOKEN_ELLIPSIS: emit_write_bytecode_byte(emit, MP_BC_LOAD_CONST_ELLIPSIS); break;
- default: assert(0);
+ default: assert(0); goto no_other_choice; // to help flow control analysis
}
}