diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-12-02 20:45:55 +0000 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-12-02 20:45:55 +0000 |
commit | 125e2785025ed1a4363800d712bdf4e782a94cd4 (patch) | |
tree | 651515557228acae2d40ea60f4ca3ac67b7cf1cb /bytecode.c | |
parent | 251f221b85216ca50329c4ef1788fc617863ce06 (diff) |
Clean up calls to C functions, unify opcodes
Diffstat (limited to 'bytecode.c')
-rw-r--r-- | bytecode.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) { |