summaryrefslogtreecommitdiffstats
path: root/bytecode.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-02 20:45:55 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-02 20:45:55 +0000
commit125e2785025ed1a4363800d712bdf4e782a94cd4 (patch)
tree651515557228acae2d40ea60f4ca3ac67b7cf1cb /bytecode.c
parent251f221b85216ca50329c4ef1788fc617863ce06 (diff)
Clean up calls to C functions, unify opcodes
Diffstat (limited to 'bytecode.c')
-rw-r--r--bytecode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bytecode.c b/bytecode.c
index bafd0474..a18f0d90 100644
--- a/bytecode.c
+++ b/bytecode.c
@@ -7,7 +7,7 @@
static int bytecode_operation_length(uint16_t* codeptr) {
if (opcode_describe(*codeptr)->flags & OP_HAS_VARIABLE_LENGTH_ARGLIST) {
- return 2 + codeptr[1] * 2;
+ return 4 + codeptr[1] * 2;
} else {
return opcode_length(*codeptr);
}
@@ -42,7 +42,7 @@ void dump_operation(struct bytecode* bc, uint16_t* codeptr) {
if (op->length > 1) {
uint16_t imm = bc->code[pc++];
if (op->flags & OP_HAS_VARIABLE_LENGTH_ARGLIST) {
- for (int i=0; i<imm; i++) {
+ for (int i=0; i<imm+1; i++) {
uint16_t level = bc->code[pc++];
uint16_t idx = bc->code[pc++];
if (idx & ARG_NEWCLOSURE) {