Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
25a506e3
Commit
25a506e3
authored
Sep 10, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ticket #216, Exceptions in __Pyx_InitGlobals() lead to a crash
parent
d2b2680d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+9
-5
No files found.
Cython/Compiler/ModuleNode.py
View file @
25a506e3
...
...
@@ -1635,6 +1635,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"{"
)
tempdecl_code
=
code
.
insertion_point
()
self
.
generate_filename_init_call
(
code
)
code
.
putln
(
"#ifdef CYTHON_REFNANNY"
)
code
.
putln
(
"void* __pyx_refchk = NULL;"
)
code
.
putln
(
"__Pyx_Refnanny = __Pyx_ImportRefcountAPI(
\
"
refnanny
\
"
);"
)
...
...
@@ -1656,7 +1657,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"/*--- Library function declarations ---*/"
)
env
.
generate_library_function_declarations
(
code
)
self
.
generate_filename_init_call
(
code
)
code
.
putln
(
"/*--- Threads initialization code ---*/"
)
code
.
putln
(
"#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS"
)
...
...
@@ -1665,12 +1665,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"#endif"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
"/*--- Initialize various global constants etc. ---*/"
)
code
.
putln
(
code
.
error_goto_if_neg
(
"__Pyx_InitGlobals()"
,
self
.
pos
))
code
.
putln
(
"/*--- Module creation code ---*/"
)
self
.
generate_module_creation_code
(
env
,
code
)
code
.
putln
(
"/*--- Initialize various global constants etc. ---*/"
)
code
.
putln
(
code
.
error_goto_if_neg
(
"__Pyx_InitGlobals()"
,
self
.
pos
))
if
Options
.
cache_builtins
:
code
.
putln
(
"/*--- Builtin init code ---*/"
)
code
.
putln
(
code
.
error_goto_if_neg
(
"__Pyx_InitCachedBuiltins()"
,
...
...
@@ -1710,9 +1710,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
put_var_xdecrefs
(
env
.
temp_entries
)
for
cname
,
type
in
code
.
funcstate
.
all_managed_temps
():
code
.
put_xdecref
(
cname
,
type
)
code
.
putln
(
'__Pyx_AddTraceback("%s");'
%
env
.
qualified_name
)
code
.
putln
(
'if (%s) {'
%
env
.
module_cname
)
code
.
putln
(
'__Pyx_AddTraceback("init %s");'
%
env
.
qualified_name
)
env
.
use_utility_code
(
Nodes
.
traceback_utility_code
)
code
.
put_decref_clear
(
env
.
module_cname
,
py_object_type
,
nanny
=
False
)
code
.
putln
(
'} else if (!PyErr_Occurred()) {'
)
code
.
putln
(
'PyErr_SetString(PyExc_ImportError, "init %s");'
%
env
.
qualified_name
)
code
.
putln
(
'}'
)
code
.
put_label
(
code
.
return_label
)
code
.
put_finish_refcount_context
()
...
...
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