-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent misuse of PyTuple_Pack #1218
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1218 +/- ##
==========================================
- Coverage 87.21% 87.21% -0.01%
==========================================
Files 113 113
Lines 10281 10277 -4
Branches 4065 4088 +23
==========================================
- Hits 8967 8963 -4
Misses 718 718
Partials 596 596 ☔ View full report in Codecov by Sentry. |
Minor suggestion.... given that all uses of this function should be placed in a JPPyObject wrapper via |
Agreed. I'll do this tonight. |
PyObject *args = PyTuple_Pack(1, PyLong_FromLongLong(l)); | ||
return JPPyObject::call(PyLong_Type.tp_new((PyTypeObject*) wrapper.get(), args, nullptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this and the two below a leak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems likely. Once had leaks everwhere. Hence need to write the C++ wrapper for python API. Clearly this was missed.
712309a
to
91d0ee8
Compare
The changes were mostly painless. I only had to think about one change which was in Seems like the mac compiler is a bit over picky about |
PyObject *args = PyTuple_Pack(1, PyLong_FromLongLong(l)); | ||
return JPPyObject::call(PyLong_Type.tp_new((PyTypeObject*) wrapper.get(), args, nullptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems likely. Once had leaks everwhere. Hence need to write the C++ wrapper for python API. Clearly this was missed.
Merge for upcoming release. |
This prevents simple mistakes such as the following
jpype/native/python/pyjp_number.cpp
Line 390 in 66f8c6c