summaryrefslogtreecommitdiff
path: root/py/bc.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/bc.c')
-rw-r--r--py/bc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/bc.c b/py/bc.c
index b98df39e2..2a21ffd4b 100644
--- a/py/bc.c
+++ b/py/bc.c
@@ -335,7 +335,11 @@ uint mp_opcode_format(const byte *ip, size_t *opcode_size, bool count_var_uint)
}
}
} else if (f == MP_BC_FORMAT_OFFSET) {
- ip += 2;
+ if ((*ip & 0x80) == 0) {
+ ip += 1;
+ } else {
+ ip += 2;
+ }
}
ip += extra_byte;
}