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
6d52bc8b
Commit
6d52bc8b
authored
Feb 26, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More refcounting fixes
parent
97f3f482
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
from_cpython/Python/traceback.c
from_cpython/Python/traceback.c
+4
-4
pyston_gdbinit.txt
pyston_gdbinit.txt
+3
-0
src/runtime/exceptions.cpp
src/runtime/exceptions.cpp
+3
-2
src/runtime/frame.cpp
src/runtime/frame.cpp
+1
-1
No files found.
from_cpython/Python/traceback.c
View file @
6d52bc8b
...
...
@@ -53,9 +53,7 @@ PyTypeObject PyTraceBack_Type = {
"traceback"
,
sizeof
(
PyTracebackObject
),
0
,
// Pyston change:
//(destructor)tb_dealloc, /*tp_dealloc*/
(
destructor
)
0
,
(
destructor
)
tb_dealloc
,
/*tp_dealloc*/
0
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
...
...
@@ -126,8 +124,10 @@ PyTraceBack_Here(PyFrameObject *frame)
int
PyTraceBack_Here_Tb
(
PyFrameObject
*
frame
,
PyTracebackObject
**
tb
)
{
if
((
PyObject
*
)
*
tb
==
Py_None
)
if
((
PyObject
*
)
*
tb
==
Py_None
)
{
Py_DECREF
(
*
tb
);
*
tb
=
NULL
;
}
*
tb
=
newtracebackobject
(
*
tb
,
frame
);
if
(
*
tb
==
NULL
)
return
-
1
;
...
...
pyston_gdbinit.txt
View file @
6d52bc8b
...
...
@@ -6,3 +6,6 @@ skip file /usr/include/c++/4.9/bits/stl_vector.h
skip pyston::ArgPassSpec::ArgPassSpec(int, int, bool, bool)
skip pyston::InternedString::getBox() const
skip pyston::BoxedString::s() const
skip pyston::autoDecref<pyston::Box, false>(pyston::Box*)
skip pyston::autoDecref<pyston::Box, true>(pyston::Box*)
src/runtime/exceptions.cpp
View file @
6d52bc8b
...
...
@@ -43,8 +43,8 @@ void raiseSyntaxError(const char* msg, int lineno, int col_offset, llvm::StringR
loc
=
Py_None
;
}
auto
args
=
BoxedTuple
::
create
({
boxString
(
file
),
boxInt
(
lineno
),
None
,
loc
});
Box
*
exc
=
runtimeCall
(
SyntaxError
,
ArgPassSpec
(
2
),
boxString
(
msg
),
args
,
NULL
,
NULL
,
NULL
);
auto
args
=
BoxedTuple
::
create
({
autoDecref
(
boxString
(
file
)),
autoDecref
(
boxInt
(
lineno
)
),
None
,
loc
});
Box
*
exc
=
runtimeCall
(
SyntaxError
,
ArgPassSpec
(
2
),
autoDecref
(
boxString
(
msg
)
),
args
,
NULL
,
NULL
,
NULL
);
assert
(
!
PyErr_Occurred
());
throw
ExcInfo
(
exc
->
cls
,
exc
,
None
);
}
else
{
...
...
@@ -166,6 +166,7 @@ extern "C" void raise0_capi(ExcInfo* frame_exc_info) noexcept {
// TODO need to clean up when we call normalize, do_raise, etc
if
(
frame_exc_info
->
type
==
None
)
{
assert
(
0
&&
"check refcounting"
);
frame_exc_info
->
type
=
TypeError
;
frame_exc_info
->
value
=
boxString
(
"exceptions must be old-style classes or derived from BaseException, not NoneType"
);
...
...
src/runtime/frame.cpp
View file @
6d52bc8b
...
...
@@ -221,7 +221,7 @@ extern "C" void deinitFrame(FrameInfo* frame_info) {
extern
"C"
int
PyFrame_GetLineNumber
(
PyFrameObject
*
_f
)
noexcept
{
BoxedInt
*
lineno
=
(
BoxedInt
*
)
BoxedFrame
::
lineno
((
Box
*
)
_f
,
NULL
);
return
lineno
->
n
;
return
autoDecref
(
lineno
)
->
n
;
}
extern
"C"
PyObject
*
PyFrame_GetGlobals
(
PyFrameObject
*
f
)
noexcept
{
...
...
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