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
67635043
Commit
67635043
authored
Oct 22, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite one more GetattrHook path
parent
a8f26653
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/capi/typeobject.cpp
src/capi/typeobject.cpp
+8
-6
No files found.
src/capi/typeobject.cpp
View file @
67635043
...
...
@@ -1012,24 +1012,26 @@ Box* slotTpGetattrHookInternal(Box* self, BoxedString* name, GetattrRewriteArgs*
return
res
;
}
else
if
(
return_convention
==
ReturnConvention
::
NO_RETURN
)
{
assert
(
!
res
);
}
else
if
(
return_convention
==
ReturnConvention
::
CAPI_RETURN
)
{
}
else
if
(
return_convention
==
ReturnConvention
::
CAPI_RETURN
||
return_convention
==
ReturnConvention
::
NOEXC_POSSIBLE
)
{
// If we get a CAPI return, we probably did a function call, and these guards
// will probably just make the rewrite fail:
if
(
res
)
{
rtn
->
addGuardNotEq
(
0
);
rewrite_args
->
setReturn
(
rtn
,
ReturnConvention
::
HAS_RETURN
);
return
res
;
}
else
rtn
->
addGuard
(
0
);
}
else
{
assert
(
return_convention
==
ReturnConvention
::
NOEXC_POSSIBLE
);
rewrite_args
=
NULL
;
// this could set a CAPI exception and we won't clear it inside the rewrite.
rewrite_args
=
0
;
}
}
else
{
RELEASE_ASSERT
(
0
,
""
);
}
}
}
else
{
try
{
assert
(
!
PyType_Check
(
self
));
// There would be a getattribute
res
=
getattrInternalGeneric
<
false
,
rewritable
>
(
self
,
name
,
NULL
,
false
,
false
,
NULL
,
NULL
);
res
=
getattrInternalGeneric
<
false
,
NOT_REWRITABLE
>
(
self
,
name
,
NULL
,
false
,
false
,
NULL
,
NULL
);
}
catch
(
ExcInfo
e
)
{
if
(
!
e
.
matches
(
AttributeError
))
{
if
(
S
==
CAPI
)
{
...
...
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