Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

@brettcannon
Copy link
Member

Part of #106

If this is accepted then an issue should be opened up about leaking locals (which is only an issue in a OOM situation).

REQUIRE(!PyErr_Occurred());

auto repr = PyUnicode_AsUTF8(PyObject_Repr(res));
Py_DECREF(res);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to constructor the std::string before doing the dec ref here, I think the lifetime of the PyUnicode_AsUTF8 is only guaranteed to be valid as long as the object is

@DinoV
Copy link
Contributor

DinoV commented Feb 10, 2016

Otherwise LGTM

@brettcannon
Copy link
Member Author

I have fixed the refcount issues, but I have discovered that the float + float type inference test is now failing with TypeError: 'int' object is not iterable which makes no sense since that test has no int, let alone something to cause an iteration.

@brettcannon
Copy link
Member Author

Turns out the test failure is only when you run all tests; if you run the [emission] or [inference] tests separately there's no issue. That suggests some problem with state that's carrying over.

@brettcannon
Copy link
Member Author

PTAL

DinoV pushed a commit that referenced this pull request Feb 11, 2016
@DinoV DinoV merged commit 5b5e55c into microsoft:master Feb 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants