summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-05-18 11:44:26 +1000
committerDamien George <damien.p.george@gmail.com>2018-05-18 11:44:26 +1000
commit46ce395130305ce3299ae0dfd42502d29837c39f (patch)
treeb63eb17c2d71487ce25989ec72abf651caf72f80
parent58331e3c28e41ad7e3c3dd7dabf6d508a8bfe1cb (diff)
py/vm: Use enum names instead of magic numbers in multi-opcode dispatch.
-rw-r--r--py/vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/vm.c b/py/vm.c
index b88cfd8d3..52e15ae33 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -1270,10 +1270,10 @@ yield:
} else if (ip[-1] < MP_BC_STORE_FAST_MULTI + 16) {
fastn[MP_BC_STORE_FAST_MULTI - (mp_int_t)ip[-1]] = POP();
DISPATCH();
- } else if (ip[-1] < MP_BC_UNARY_OP_MULTI + 7) {
+ } else if (ip[-1] < MP_BC_UNARY_OP_MULTI + MP_UNARY_OP_NUM_BYTECODE) {
SET_TOP(mp_unary_op(ip[-1] - MP_BC_UNARY_OP_MULTI, TOP()));
DISPATCH();
- } else if (ip[-1] < MP_BC_BINARY_OP_MULTI + 36) {
+ } else if (ip[-1] < MP_BC_BINARY_OP_MULTI + MP_BINARY_OP_NUM_BYTECODE) {
mp_obj_t rhs = POP();
mp_obj_t lhs = TOP();
SET_TOP(mp_binary_op(ip[-1] - MP_BC_BINARY_OP_MULTI, lhs, rhs));