diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-06-27 14:06:26 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-06-27 14:06:26 -0700 |
| commit | 0cce7fcaa3295d18f4fb7e10821ab692d5b2f4d7 (patch) | |
| tree | 81ca7ee2cf4f8b47316c916bc9b53e47c53cda2b /py/emitglue.c | |
| parent | 72ea216dceff146ff654e6652e5535064dfe69ee (diff) | |
| parent | c562b1923885d67fd349e48da841715f3a5522dd (diff) | |
Merge remote-tracking branch 'adafruit/4.0.x' into merge_in_402
Diffstat (limited to 'py/emitglue.c')
| -rw-r--r-- | py/emitglue.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/py/emitglue.c b/py/emitglue.c index 74bf8ddca..7708689dd 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -142,11 +142,12 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar fun = mp_obj_new_fun_asm(rc->n_pos_args, rc->data.u_native.fun_data, rc->data.u_native.type_sig); break; #endif - default: - // rc->kind should always be set and BYTECODE is the only remaining case - assert(rc->kind == MP_CODE_BYTECODE); + case MP_CODE_BYTECODE: fun = mp_obj_new_fun_bc(def_args, def_kw_args, rc->data.u_byte.bytecode, rc->data.u_byte.const_table); break; + default: + // All other kinds are invalid. + mp_raise_RuntimeError(translate("Corrupt raw code")); } // check for generator functions and if so wrap in generator object |
