Commit 104730f6 authored by Kevin Modzelewski's avatar Kevin Modzelewski

More ref fixes

parent 6d52bc8b
...@@ -272,10 +272,15 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit) ...@@ -272,10 +272,15 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit)
PyString_AsString(tb->tb_frame->f_code->co_name)); PyString_AsString(tb->tb_frame->f_code->co_name));
*/ */
PyCodeObject* code = (PyCodeObject*)PyFrame_GetCode(tb->tb_frame); PyCodeObject* code = (PyCodeObject*)PyFrame_GetCode(tb->tb_frame);
PyObject* filename = PyCode_GetFilename(code);
PyObject* name = PyCode_GetName(code);
err = tb_displayline(f, err = tb_displayline(f,
PyString_AsString(PyCode_GetFilename(code)), PyString_AsString(filename),
tb->tb_lineno, tb->tb_lineno,
PyString_AsString(PyCode_GetName(code))); PyString_AsString(name));
Py_DECREF(name);
Py_DECREF(filename);
Py_DECREF(code);
} }
depth--; depth--;
tb = tb->tb_next; tb = tb->tb_next;
......
...@@ -28,12 +28,12 @@ BoxedClass* code_cls; ...@@ -28,12 +28,12 @@ BoxedClass* code_cls;
Box* BoxedCode::name(Box* b, void*) { Box* BoxedCode::name(Box* b, void*) {
RELEASE_ASSERT(b->cls == code_cls, ""); RELEASE_ASSERT(b->cls == code_cls, "");
return static_cast<BoxedCode*>(b)->f->source->getName(); return incref(static_cast<BoxedCode*>(b)->f->source->getName());
} }
Box* BoxedCode::filename(Box* b, void*) { Box* BoxedCode::filename(Box* b, void*) {
RELEASE_ASSERT(b->cls == code_cls, ""); RELEASE_ASSERT(b->cls == code_cls, "");
return static_cast<BoxedCode*>(b)->f->source->getFn(); return incref(static_cast<BoxedCode*>(b)->f->source->getFn());
} }
Box* BoxedCode::firstlineno(Box* b, void*) { Box* BoxedCode::firstlineno(Box* b, void*) {
......
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