Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
806a6572
Commit
806a6572
authored
May 09, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
_PyInstance_Lookup returns a borrowed reference
parent
183aa5f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
from_cpython/Include/classobject.h
from_cpython/Include/classobject.h
+1
-1
from_cpython/Lib/test/test_shutil.py
from_cpython/Lib/test/test_shutil.py
+0
-2
src/runtime/classobj.cpp
src/runtime/classobj.cpp
+2
-2
No files found.
from_cpython/Include/classobject.h
View file @
806a6572
...
...
@@ -81,7 +81,7 @@ PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *) PYSTON_NOEXCEPT;
* can't fail, never sets an exception, and NULL is not an error (it just
* means "not found").
*/
PyAPI_FUNC
(
PyObject
*
)
_PyInstance_Lookup
(
PyObject
*
pinst
,
PyObject
*
name
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
BORROWED
(
PyObject
*
)
)
_PyInstance_Lookup
(
PyObject
*
pinst
,
PyObject
*
name
)
PYSTON_NOEXCEPT
;
// Pyston change: no longer macros
#if 0
...
...
from_cpython/Lib/test/test_shutil.py
View file @
806a6572
# expected: reffail
# - leaked refs, some test failures?
# Copyright (C) 2003 Python Software Foundation
import
unittest
...
...
src/runtime/classobj.cpp
View file @
806a6572
...
...
@@ -77,7 +77,7 @@ static BORROWED(Box*) classLookup(BoxedClassobj* cls, BoxedString* attr) {
return
classLookup
<
NOT_REWRITABLE
>
(
cls
,
attr
,
NULL
);
}
extern
"C"
PyObject
*
_PyInstance_Lookup
(
PyObject
*
pinst
,
PyObject
*
pname
)
noexcept
{
extern
"C"
BORROWED
(
PyObject
*
)
_PyInstance_Lookup
(
PyObject
*
pinst
,
PyObject
*
pname
)
noexcept
{
RELEASE_ASSERT
(
PyInstance_Check
(
pinst
),
""
);
BoxedInstance
*
inst
=
(
BoxedInstance
*
)
pinst
;
...
...
@@ -92,7 +92,7 @@ extern "C" PyObject* _PyInstance_Lookup(PyObject* pinst, PyObject* pname) noexce
Box
*
v
=
inst
->
getattr
(
name
);
if
(
v
==
NULL
)
v
=
classLookup
(
inst
->
inst_cls
,
name
);
return
xincref
(
v
)
;
return
v
;
}
catch
(
ExcInfo
e
)
{
setCAPIException
(
e
);
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment