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
Kirill Smelkov
cython
Commits
1257fc62
Commit
1257fc62
authored
Apr 29, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error handling for module init sub-functions, which failed to set the error position correctly.
parent
8142ffab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-7
No files found.
Cython/Compiler/ModuleNode.py
View file @
1257fc62
...
@@ -2296,7 +2296,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -2296,7 +2296,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
exit_cfunc_scope
()
# done with labels
code
.
exit_cfunc_scope
()
# done with labels
def
generate_module_init_func
(
self
,
imported_modules
,
env
,
code
):
def
generate_module_init_func
(
self
,
imported_modules
,
env
,
code
):
subfunction
=
self
.
mod_init_subfunction
(
self
.
scope
,
code
)
subfunction
=
self
.
mod_init_subfunction
(
self
.
pos
,
self
.
scope
,
code
)
code
.
enter_cfunc_scope
(
self
.
scope
)
code
.
enter_cfunc_scope
(
self
.
scope
)
code
.
putln
(
""
)
code
.
putln
(
""
)
...
@@ -2422,10 +2422,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -2422,10 +2422,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
Options
.
cache_builtins
:
if
Options
.
cache_builtins
:
code
.
putln
(
"/*--- Builtin init code ---*/"
)
code
.
putln
(
"/*--- Builtin init code ---*/"
)
code
.
put_error_if_neg
(
None
,
"__Pyx_InitCachedBuiltins()"
)
code
.
put_error_if_neg
(
self
.
pos
,
"__Pyx_InitCachedBuiltins()"
)
code
.
putln
(
"/*--- Constants init code ---*/"
)
code
.
putln
(
"/*--- Constants init code ---*/"
)
code
.
put_error_if_neg
(
None
,
"__Pyx_InitCachedConstants()"
)
code
.
put_error_if_neg
(
self
.
pos
,
"__Pyx_InitCachedConstants()"
)
code
.
putln
(
"/*--- Global type/function init code ---*/"
)
code
.
putln
(
"/*--- Global type/function init code ---*/"
)
...
@@ -2516,7 +2516,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -2516,7 +2516,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
exit_cfunc_scope
()
code
.
exit_cfunc_scope
()
def
mod_init_subfunction
(
self
,
scope
,
orig_code
):
def
mod_init_subfunction
(
self
,
pos
,
scope
,
orig_code
):
"""
"""
Return a context manager that allows deviating the module init code generation
Return a context manager that allows deviating the module init code generation
into a separate function and instead inserts a call to it.
into a separate function and instead inserts a call to it.
...
@@ -2572,9 +2572,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -2572,9 +2572,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
""
)
code
.
putln
(
""
)
if
needs_error_handling
:
if
needs_error_handling
:
self
.
call_code
.
use_label
(
orig_code
.
error_label
)
self
.
call_code
.
putln
(
self
.
call_code
.
putln
(
"if (unlikely(%s() != 0)) goto %s;"
%
(
self
.
call_code
.
error_goto_if_neg
(
"%s()"
%
self
.
cfunc_name
,
pos
))
self
.
cfunc_name
,
orig_code
.
error_label
))
else
:
else
:
self
.
call_code
.
putln
(
"(void)%s();"
%
self
.
cfunc_name
)
self
.
call_code
.
putln
(
"(void)%s();"
%
self
.
cfunc_name
)
self
.
call_code
=
None
self
.
call_code
=
None
...
...
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