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
42014a09
Commit
42014a09
authored
Nov 18, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more refcounting fixes for exceptions
parent
63a6c334
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
5 deletions
+13
-5
src/runtime/capi.cpp
src/runtime/capi.cpp
+8
-0
src/runtime/exceptions.cpp
src/runtime/exceptions.cpp
+2
-3
src/runtime/import.cpp
src/runtime/import.cpp
+1
-0
src/runtime/objmodel.h
src/runtime/objmodel.h
+1
-1
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
No files found.
src/runtime/capi.cpp
View file @
42014a09
...
@@ -848,9 +848,17 @@ extern "C" void Py_Exit(int sts) noexcept {
...
@@ -848,9 +848,17 @@ extern "C" void Py_Exit(int sts) noexcept {
}
}
extern
"C"
void
PyErr_Restore
(
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
traceback
)
noexcept
{
extern
"C"
void
PyErr_Restore
(
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
traceback
)
noexcept
{
auto
oldtype
=
cur_thread_state
.
curexc_type
;
auto
oldvalue
=
cur_thread_state
.
curexc_value
;
auto
oldtraceback
=
cur_thread_state
.
curexc_traceback
;
cur_thread_state
.
curexc_type
=
type
;
cur_thread_state
.
curexc_type
=
type
;
cur_thread_state
.
curexc_value
=
value
;
cur_thread_state
.
curexc_value
=
value
;
cur_thread_state
.
curexc_traceback
=
traceback
;
cur_thread_state
.
curexc_traceback
=
traceback
;
Py_XDECREF
(
oldtype
);
Py_XDECREF
(
oldvalue
);
Py_XDECREF
(
oldtraceback
);
}
}
extern
"C"
void
PyErr_Clear
()
noexcept
{
extern
"C"
void
PyErr_Clear
()
noexcept
{
...
...
src/runtime/exceptions.cpp
View file @
42014a09
...
@@ -28,7 +28,7 @@ namespace pyston {
...
@@ -28,7 +28,7 @@ namespace pyston {
void
raiseExc
(
Box
*
exc_obj
)
{
void
raiseExc
(
Box
*
exc_obj
)
{
assert
(
!
PyErr_Occurred
());
assert
(
!
PyErr_Occurred
());
throw
ExcInfo
(
exc_obj
->
cls
,
exc_obj
,
None
);
throw
ExcInfo
(
incref
(
exc_obj
->
cls
),
exc_obj
,
incref
(
None
)
);
}
}
// Have a special helper function for syntax errors, since we want to include the location
// Have a special helper function for syntax errors, since we want to include the location
...
@@ -231,8 +231,7 @@ void raiseExcHelper(BoxedClass* cls, const char* msg, ...) {
...
@@ -231,8 +231,7 @@ void raiseExcHelper(BoxedClass* cls, const char* msg, ...) {
va_end
(
ap
);
va_end
(
ap
);
BoxedString
*
message
=
boxString
(
buf
);
BoxedString
*
message
=
boxString
(
buf
);
Box
*
exc_obj
=
runtimeCall
(
cls
,
ArgPassSpec
(
1
),
message
,
NULL
,
NULL
,
NULL
,
NULL
);
Box
*
exc_obj
=
runtimeCall
(
cls
,
ArgPassSpec
(
1
),
autoDecref
(
message
),
NULL
,
NULL
,
NULL
,
NULL
);
Py_DECREF
(
message
);
raiseExc
(
exc_obj
);
raiseExc
(
exc_obj
);
}
else
{
}
else
{
Box
*
exc_obj
=
runtimeCall
(
cls
,
ArgPassSpec
(
0
),
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
Box
*
exc_obj
=
runtimeCall
(
cls
,
ArgPassSpec
(
0
),
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
...
...
src/runtime/import.cpp
View file @
42014a09
...
@@ -515,6 +515,7 @@ Box* importModuleLevel(llvm::StringRef name, Box* globals, Box* from_imports, in
...
@@ -515,6 +515,7 @@ Box* importModuleLevel(llvm::StringRef name, Box* globals, Box* from_imports, in
bool
again
=
loadNext
(
parent
,
level
<
0
?
None
:
parent
,
_name
,
buf
,
&
head
);
bool
again
=
loadNext
(
parent
,
level
<
0
?
None
:
parent
,
_name
,
buf
,
&
head
);
if
(
head
==
NULL
)
if
(
head
==
NULL
)
return
NULL
;
return
NULL
;
assert
((
!
again
)
&&
"check refcounting"
);
Box
*
tail
=
head
;
Box
*
tail
=
head
;
while
(
again
)
{
while
(
again
)
{
...
...
src/runtime/objmodel.h
View file @
42014a09
...
@@ -37,7 +37,7 @@ extern "C" void raise0(ExcInfo* frame_exc_info) __attribute__((__noreturn__));
...
@@ -37,7 +37,7 @@ extern "C" void raise0(ExcInfo* frame_exc_info) __attribute__((__noreturn__));
extern
"C"
void
raise0_capi
(
ExcInfo
*
frame_exc_info
)
noexcept
;
extern
"C"
void
raise0_capi
(
ExcInfo
*
frame_exc_info
)
noexcept
;
extern
"C"
void
raise3
(
Box
*
,
Box
*
,
Box
*
)
__attribute__
((
__noreturn__
));
extern
"C"
void
raise3
(
Box
*
,
Box
*
,
Box
*
)
__attribute__
((
__noreturn__
));
extern
"C"
void
raise3_capi
(
Box
*
,
Box
*
,
Box
*
)
noexcept
;
extern
"C"
void
raise3_capi
(
Box
*
,
Box
*
,
Box
*
)
noexcept
;
void
raiseExc
(
Box
*
exc_obj
)
__attribute__
((
__noreturn__
));
void
raiseExc
(
STOLEN
(
Box
*
)
exc_obj
)
__attribute__
((
__noreturn__
));
void
_printStacktrace
();
void
_printStacktrace
();
extern
"C"
Box
*
deopt
(
AST_expr
*
expr
,
Box
*
value
);
extern
"C"
Box
*
deopt
(
AST_expr
*
expr
,
Box
*
value
);
...
...
src/runtime/types.cpp
View file @
42014a09
...
@@ -4150,8 +4150,8 @@ void setupRuntime() {
...
@@ -4150,8 +4150,8 @@ void setupRuntime() {
setupBuiltins
();
setupBuiltins
();
_PyExc_Init
();
_PyExc_Init
();
setupThread
();
setupThread
();
//initgc();
setupImport
();
setupImport
();
initgc
();
setupPyston
();
setupPyston
();
setupAST
();
setupAST
();
...
...
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