Fix a bug in lexical scoping, add tests
This commit is contained in:
1 parent
463b175cdb
commit
f25cb16e6b
4 files changed
+18
-15
No files matched your search
+4
-1
@@ -418,7 +418,10 @@ static void compile(struct bytecode* bc, block b) {
|
||||
default: assert(0 && "Unknown type of argument");
|
||||
case CLOSURE_CREATE:
|
||||
code[pos++] = curr->bound_by->imm.intval | ARG_NEWCLOSURE;
|
||||
if (i == 0) desired_params = bc->subfunctions[curr->bound_by->imm.intval]->nclosures;
|
||||
if (i == 0) {
|
||||
inst* i = curr->bound_by;
|
||||
desired_params = i->compiled->subfunctions[i->imm.intval]->nclosures;
|
||||
}
|
||||
break;
|
||||
case CLOSURE_PARAM:
|
||||
code[pos++] = curr->bound_by->imm.intval;
|
||||
|
||||
Reference in new issue
Block a user