Commit d0988f35 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix nested closures

parent 33ca0bc5
......@@ -1328,6 +1328,7 @@ private:
llvm::Value* closureValue = closure->makeConverted(emitter, CLOSURE)->getValue();
for (int i = 0; i < deref_info.num_parents_from_passed_closure; i++) {
closureValue = emitter.getBuilder()->CreateLoad(getClosureParentGep(emitter, closureValue));
emitter.setType(closureValue, RefType::BORROWED);
}
llvm::Value* lookupResult
= emitter.getBuilder()->CreateLoad(getClosureElementGep(emitter, closureValue, deref_info.offset));
......
......@@ -4013,6 +4013,8 @@ void BoxedClosure::dealloc(Box* _o) noexcept {
Py_XDECREF(o->elts[i]);
}
Py_XDECREF(o->parent);
o->cls->tp_free(o);
}
......
# expected: reffail
# - locals() returns None for undefined values due to the changes refcounting made to how we store uninitialized variables.
def f1():
l = []
for i in xrange(5):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment