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
1f3346fd
Commit
1f3346fd
authored
Apr 12, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cpython_oldstyle_getattr_crash.py
It was just an error-message difference.
parent
7e3c7350
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
src/runtime/classobj.cpp
src/runtime/classobj.cpp
+12
-4
test/tests/cpython_oldstyle_getattr_crash.py
test/tests/cpython_oldstyle_getattr_crash.py
+1
-2
test/tests/generator_tracebacks.py
test/tests/generator_tracebacks.py
+0
-1
test/tests/inheritance.py
test/tests/inheritance.py
+0
-1
No files found.
src/runtime/classobj.cpp
View file @
1f3346fd
...
...
@@ -472,10 +472,18 @@ static Box* _instanceGetattribute(Box* _inst, BoxedString* attr_str, bool raise_
return
incref
(
inst
->
inst_cls
);
}
Box
*
attr
=
instanceGetattributeWithFallback
<
rewritable
>
(
inst
,
attr_str
,
rewrite_args
);
if
(
attr
)
{
return
attr
;
}
else
if
(
!
raise_on_missing
)
{
try
{
Box
*
attr
=
instanceGetattributeWithFallback
<
rewritable
>
(
inst
,
attr_str
,
rewrite_args
);
if
(
attr
)
return
attr
;
}
catch
(
ExcInfo
e
)
{
if
(
!
raise_on_missing
&&
e
.
matches
(
AttributeError
))
{
e
.
clear
();
return
NULL
;
}
throw
e
;
}
if
(
!
raise_on_missing
)
{
return
NULL
;
}
else
{
raiseExcHelper
(
AttributeError
,
"%s instance has no attribute '%s'"
,
inst
->
inst_cls
->
name
->
data
(),
...
...
test/tests/cpython_oldstyle_getattr_crash.py
View file @
1f3346fd
# expected: reffail
# This segfaults under python-dbg
# (In a release build it "works" since the use-after-free happens without penalty.)
...
...
@@ -7,7 +6,7 @@ class C:
del
self
print
"C.__getattr__"
,
attr
del
D
.
__get__
raise
AttributeError
()
raise
AttributeError
(
"our attribute error"
)
class
D
(
object
):
__get__
=
C
()
...
...
test/tests/generator_tracebacks.py
View file @
1f3346fd
# expected: reffail
# Generators participate in the notional Python stack just like normal function calls do,
# even if we implement them using separate C stacks.
#
...
...
test/tests/inheritance.py
View file @
1f3346fd
# expected: reffail
def
f1
():
class
C
(
object
):
...
...
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