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
20cb1ccb
Commit
20cb1ccb
authored
Jul 05, 2016
by
Marius Wachtler
Committed by
GitHub
Jul 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1281 from undingen/deinitFrame_exc
deinitFrame: don't modify CAPI exception state
parents
a0affc4e
f5a40a2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
src/runtime/frame.cpp
src/runtime/frame.cpp
+14
-2
src/runtime/types.h
src/runtime/types.h
+2
-2
No files found.
src/runtime/frame.cpp
View file @
20cb1ccb
...
...
@@ -253,16 +253,24 @@ void FrameInfo::disableDeinit(FrameInfo* replacement_frame) {
assert
(
isDisabledFrame
());
}
extern
"C"
void
deinitFrameMaybe
(
FrameInfo
*
frame_info
)
{
extern
"C"
void
deinitFrameMaybe
(
FrameInfo
*
frame_info
)
noexcept
{
// Note: this has to match FrameInfo::disableDeinit
if
(
!
frame_info
->
isDisabledFrame
())
deinitFrame
(
frame_info
);
}
extern
"C"
void
deinitFrame
(
FrameInfo
*
frame_info
)
{
extern
"C"
void
deinitFrame
(
FrameInfo
*
frame_info
)
noexcept
{
// This can fire if we have a call to deinitFrame() that should be to deinitFrameMaybe() instead
assert
(
!
frame_info
->
isDisabledFrame
());
Box
*
err_type
,
*
err_value
,
*
err_tb
;
bool
restore_exc
=
cur_thread_state
.
curexc_type
!=
NULL
;
if
(
restore_exc
)
{
// preserve the existing exception
PyErr_Fetch
(
&
err_type
,
&
err_value
,
&
err_tb
);
PyErr_Clear
();
}
assert
(
cur_thread_state
.
frame_info
==
frame_info
);
cur_thread_state
.
frame_info
=
frame_info
->
back
;
BoxedFrame
*
frame
=
frame_info
->
frame_obj
;
...
...
@@ -288,6 +296,10 @@ extern "C" void deinitFrame(FrameInfo* frame_info) {
}
Py_CLEAR
(
frame_info
->
globals
);
assert
(
!
PyErr_Occurred
());
if
(
restore_exc
)
PyErr_Restore
(
err_type
,
err_value
,
err_tb
);
}
int
frameinfo_traverse
(
FrameInfo
*
frame_info
,
visitproc
visit
,
void
*
arg
)
noexcept
{
...
...
src/runtime/types.h
View file @
20cb1ccb
...
...
@@ -1307,8 +1307,8 @@ FunctionMetadata* metadataFromCode(Box* code);
BORROWED
(
Box
*
)
getFrame
(
FrameInfo
*
frame_info
);
BORROWED
(
Box
*
)
getFrame
(
int
depth
);
void
frameInvalidateBack
(
BoxedFrame
*
frame
);
extern
"C"
void
deinitFrame
(
FrameInfo
*
frame_info
);
extern
"C"
void
deinitFrameMaybe
(
FrameInfo
*
frame_info
);
extern
"C"
void
deinitFrame
(
FrameInfo
*
frame_info
)
noexcept
;
extern
"C"
void
deinitFrameMaybe
(
FrameInfo
*
frame_info
)
noexcept
;
int
frameinfo_traverse
(
FrameInfo
*
frame_info
,
visitproc
visit
,
void
*
arg
)
noexcept
;
extern
"C"
void
initFrame
(
FrameInfo
*
frame_info
);
extern
"C"
void
setFrameExcInfo
(
FrameInfo
*
frame_info
,
STOLEN
(
Box
*
)
type
,
STOLEN
(
Box
*
)
value
,
STOLEN
(
Box
*
)
tb
);
...
...
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