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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
790b0994
Commit
790b0994
authored
Sep 17, 2018
by
Matt Wozniski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perform <object>NULL check for "except +" calls
parent
a19b8a99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+13
-11
No files found.
Cython/Compiler/ExprNodes.py
View file @
790b0994
...
@@ -5838,7 +5838,7 @@ class SimpleCallNode(CallNode):
...
@@ -5838,7 +5838,7 @@ class SimpleCallNode(CallNode):
elif
self
.
type
.
is_memoryviewslice
:
elif
self
.
type
.
is_memoryviewslice
:
assert
self
.
is_temp
assert
self
.
is_temp
exc_checks
.
append
(
self
.
type
.
error_condition
(
self
.
result
()))
exc_checks
.
append
(
self
.
type
.
error_condition
(
self
.
result
()))
el
se
:
el
if
func_type
.
exception_check
!=
'+'
:
exc_val
=
func_type
.
exception_value
exc_val
=
func_type
.
exception_value
exc_check
=
func_type
.
exception_check
exc_check
=
func_type
.
exception_check
if
exc_val
is
not
None
:
if
exc_val
is
not
None
:
...
@@ -5859,20 +5859,22 @@ class SimpleCallNode(CallNode):
...
@@ -5859,20 +5859,22 @@ class SimpleCallNode(CallNode):
rhs
=
typecast
(
py_object_type
,
self
.
type
,
rhs
)
rhs
=
typecast
(
py_object_type
,
self
.
type
,
rhs
)
else
:
else
:
lhs
=
""
lhs
=
""
if
(
self
.
overflowcheck
and
self
.
type
.
is_int
and
self
.
type
.
signed
and
self
.
function
.
result
()
in
(
'abs'
,
'labs'
,
'__Pyx_abs_longlong'
)):
goto_error
=
'if (unlikely(%s < 0)) { PyErr_SetString(PyExc_OverflowError, "value too large"); %s; }'
%
(
self
.
result
(),
code
.
error_goto
(
self
.
pos
))
elif
exc_checks
:
goto_error
=
code
.
error_goto_if
(
" && "
.
join
(
exc_checks
),
self
.
pos
)
else
:
goto_error
=
""
if
func_type
.
exception_check
==
'+'
:
if
func_type
.
exception_check
==
'+'
:
translate_cpp_exception
(
code
,
self
.
pos
,
'%s%s;'
%
(
lhs
,
rhs
),
translate_cpp_exception
(
code
,
self
.
pos
,
'%s%s;'
%
(
lhs
,
rhs
),
func_type
.
exception_value
,
self
.
nogil
)
func_type
.
exception_value
,
self
.
nogil
)
if
goto_error
:
code
.
putln
(
goto_error
)
else
:
else
:
if
(
self
.
overflowcheck
and
self
.
type
.
is_int
and
self
.
type
.
signed
and
self
.
function
.
result
()
in
(
'abs'
,
'labs'
,
'__Pyx_abs_longlong'
)):
goto_error
=
'if (unlikely(%s < 0)) { PyErr_SetString(PyExc_OverflowError, "value too large"); %s; }'
%
(
self
.
result
(),
code
.
error_goto
(
self
.
pos
))
elif
exc_checks
:
goto_error
=
code
.
error_goto_if
(
" && "
.
join
(
exc_checks
),
self
.
pos
)
else
:
goto_error
=
""
code
.
putln
(
"%s%s; %s"
%
(
lhs
,
rhs
,
goto_error
))
code
.
putln
(
"%s%s; %s"
%
(
lhs
,
rhs
,
goto_error
))
if
self
.
type
.
is_pyobject
and
self
.
result
():
if
self
.
type
.
is_pyobject
and
self
.
result
():
code
.
put_gotref
(
self
.
py_result
())
code
.
put_gotref
(
self
.
py_result
())
...
...
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