Clean up calls to C functions, unify opcodes

This commit is contained in:
Stephen Dolan committed 2012-12-02 20:45:55 +00:00
1 parent 251f221b85
commit 125e278502
6 files changed
+51 -71

No files matched your search

+2 -2
View File
@@ -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) {