Commit 8a46f2e0 authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Kevin Modzelewski

A bunch of small fixes

parent e2c3ff8f
......@@ -548,7 +548,7 @@ void Rewriter::_incref(RewriterVar* var, int num_refs) {
if (var->isConstant() && !Rewriter::isLargeConstant(var->constant_value)) {
for (int i = 0; i < num_refs; i++) {
assembler->incq(assembler::Immediate(var->constant_value));
assembler->incq(assembler::Immediate((uint64_t)var->constant_value + offsetof(Box, ob_refcnt)));
}
} else {
auto reg = var->getInReg();
......
......@@ -1945,6 +1945,8 @@ private:
if (prev) {
auto load = emitter.getBuilder()->CreateLoad(gep);
emitter.setType(load, RefType::OWNED);
if (maybe_was_undefined)
emitter.setNullable(load, true);
}
llvm::Value* v = val->makeConverted(emitter, UNKNOWN)->getValue();
auto store = emitter.getBuilder()->CreateStore(v, gep);
......
......@@ -443,6 +443,7 @@ static int main(int argc, char** argv) noexcept {
Box* module = PyImport_ImportModule("site");
if (!module)
throwCAPIException();
Py_DECREF(module);
} catch (ExcInfo e) {
e.printExcAndTraceback();
e.clear();
......
......@@ -222,8 +222,7 @@ BORROWED(Box*) getFrame(int depth) {
void frameInvalidateBack(BoxedFrame* frame) {
RELEASE_ASSERT(!frame->hasExited(), "should not happen");
assert(!frame->_back && "have to decref it");
frame->_back = NULL;
Py_CLEAR(frame->_back);
}
extern "C" void initFrame(FrameInfo* frame_info) {
......
......@@ -5,7 +5,7 @@ def smallest():
n = n * 0.99
return n
for i in xrange(1000):
for i in xrange(100):
print smallest()
def test(x):
......
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