Skip to content

Commit 25042b1

Browse files
committed
py: Make arg to MP_BC_RAISE_VARARGS a byte.
1 parent ad97f2a commit 25042b1

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

py/bc0.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
#define MP_BC_UNPACK_EX (0x7a) // uint
8282

8383
#define MP_BC_RETURN_VALUE (0x80)
84-
#define MP_BC_RAISE_VARARGS (0x81) // uint
84+
#define MP_BC_RAISE_VARARGS (0x81) // byte
8585
#define MP_BC_YIELD_VALUE (0x82)
8686
#define MP_BC_YIELD_FROM (0x83)
8787

py/emitbc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,9 @@ static void emit_bc_return_value(emit_t *emit) {
672672
}
673673

674674
static void emit_bc_raise_varargs(emit_t *emit, int n_args) {
675-
assert(n_args >= 0);
675+
assert(0 <= n_args && n_args <= 2);
676676
emit_pre(emit, -n_args);
677-
emit_write_byte_1_uint(emit, MP_BC_RAISE_VARARGS, n_args);
677+
emit_write_byte_1_byte(emit, MP_BC_RAISE_VARARGS, n_args);
678678
}
679679

680680
static void emit_bc_yield_value(emit_t *emit) {

py/vm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t **
479479
assert(unum == 1);
480480
obj1 = POP();
481481
nlr_jump(obj1);
482-
return false;
483482

484483
case MP_BC_YIELD_VALUE:
485484
nlr_pop();

0 commit comments

Comments
 (0)