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
387799ab
Commit
387799ab
authored
Aug 21, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sanitize exception checking cpp subscript operations
parent
9c739285
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-6
No files found.
Cython/Compiler/ExprNodes.py
View file @
387799ab
...
@@ -3905,7 +3905,7 @@ class IndexNode(_IndexingBaseNode):
...
@@ -3905,7 +3905,7 @@ class IndexNode(_IndexingBaseNode):
func_type
=
func_type
.
base_type
func_type
=
func_type
.
base_type
self
.
exception_check
=
func_type
.
exception_check
self
.
exception_check
=
func_type
.
exception_check
self
.
exception_value
=
func_type
.
exception_value
self
.
exception_value
=
func_type
.
exception_value
if
self
.
exception_check
:
if
self
.
exception_check
==
'+'
:
if
not
setting
:
if
not
setting
:
self
.
is_temp
=
True
self
.
is_temp
=
True
if
self
.
exception_value
is
None
:
if
self
.
exception_value
is
None
:
...
@@ -3949,9 +3949,8 @@ class IndexNode(_IndexingBaseNode):
...
@@ -3949,9 +3949,8 @@ class IndexNode(_IndexingBaseNode):
return
self
return
self
self
.
exception_check
=
func_type
.
exception_check
self
.
exception_check
=
func_type
.
exception_check
self
.
exception_value
=
func_type
.
exception_value
self
.
exception_value
=
func_type
.
exception_value
if
self
.
exception_check
:
if
self
.
exception_check
==
'+'
and
self
.
exception_value
is
None
:
if
self
.
exception_value
is
None
:
env
.
use_utility_code
(
UtilityCode
.
load_cached
(
"CppExceptionConversion"
,
"CppSupport.cpp"
))
env
.
use_utility_code
(
UtilityCode
.
load_cached
(
"CppExceptionConversion"
,
"CppSupport.cpp"
))
self
.
index
=
self
.
index
.
coerce_to
(
func_type
.
args
[
0
].
type
,
env
)
self
.
index
=
self
.
index
.
coerce_to
(
func_type
.
args
[
0
].
type
,
env
)
if
not
deleting
:
if
not
deleting
:
self
.
type
=
func_type
.
args
[
1
].
type
self
.
type
=
func_type
.
args
[
1
].
type
...
@@ -4265,7 +4264,7 @@ class IndexNode(_IndexingBaseNode):
...
@@ -4265,7 +4264,7 @@ class IndexNode(_IndexingBaseNode):
function
=
"__Pyx_GetItemInt_ByteArray"
function
=
"__Pyx_GetItemInt_ByteArray"
error_value
=
'-1'
error_value
=
'-1'
utility_code
=
UtilityCode
.
load_cached
(
"GetItemIntByteArray"
,
"StringTools.c"
)
utility_code
=
UtilityCode
.
load_cached
(
"GetItemIntByteArray"
,
"StringTools.c"
)
elif
not
(
self
.
base
.
type
.
is_cpp_class
and
self
.
exception_check
):
elif
not
(
self
.
base
.
type
.
is_cpp_class
and
self
.
exception_check
==
'+'
):
assert
False
,
"unexpected type %s and base type %s for indexing"
%
(
assert
False
,
"unexpected type %s and base type %s for indexing"
%
(
self
.
type
,
self
.
base
.
type
)
self
.
type
,
self
.
base
.
type
)
...
@@ -4277,7 +4276,7 @@ class IndexNode(_IndexingBaseNode):
...
@@ -4277,7 +4276,7 @@ class IndexNode(_IndexingBaseNode):
else
:
else
:
index_code
=
self
.
index
.
py_result
()
index_code
=
self
.
index
.
py_result
()
if
self
.
base
.
type
.
is_cpp_class
and
self
.
exception_check
:
if
self
.
base
.
type
.
is_cpp_class
and
self
.
exception_check
==
'+'
:
base_result
=
self
.
base
.
result
()
base_result
=
self
.
base
.
result
()
if
self
.
base
.
type
.
is_cyp_class
:
if
self
.
base
.
type
.
is_cyp_class
:
base_result
=
"(*%s)"
%
base_result
base_result
=
"(*%s)"
%
base_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