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
066f73b9
Commit
066f73b9
authored
Feb 12, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
0b383fa4
6496c017
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
24 deletions
+26
-24
CHANGES.rst
CHANGES.rst
+1
-1
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-0
Cython/Utility/Overflow.c
Cython/Utility/Overflow.c
+23
-23
No files found.
CHANGES.rst
View file @
066f73b9
...
@@ -166,7 +166,7 @@ Other changes
...
@@ -166,7 +166,7 @@ Other changes
*
Support
for
Python
2.6
was
removed
.
*
Support
for
Python
2.6
was
removed
.
0.29.15
(
20
??-??-??
)
0.29.15
(
20
20
-
02
-
06
)
====================
====================
*
Crash
when
returning
a
temporary
Python
object
from
an
async
-
def
function
.
*
Crash
when
returning
a
temporary
Python
object
from
an
async
-
def
function
.
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
066f73b9
...
@@ -1765,7 +1765,9 @@ if VALUE is not None:
...
@@ -1765,7 +1765,9 @@ if VALUE is not None:
},
},
level
=
'c_class'
,
pipeline
=
[
NormalizeTree
(
None
)]).
substitute
({})
level
=
'c_class'
,
pipeline
=
[
NormalizeTree
(
None
)]).
substitute
({})
pickle_func
.
analyse_declarations
(
node
.
scope
)
pickle_func
.
analyse_declarations
(
node
.
scope
)
self
.
enter_scope
(
node
,
node
.
scope
)
# functions should be visited in the class scope
self
.
visit
(
pickle_func
)
self
.
visit
(
pickle_func
)
self
.
exit_scope
()
node
.
body
.
stats
.
append
(
pickle_func
)
node
.
body
.
stats
.
append
(
pickle_func
)
def
_handle_fused_def_decorators
(
self
,
old_decorators
,
env
,
node
):
def
_handle_fused_def_decorators
(
self
,
old_decorators
,
env
,
node
):
...
...
Cython/Utility/Overflow.c
View file @
066f73b9
...
@@ -20,10 +20,10 @@ TODO: Conditionally support 128-bit with intmax_t?
...
@@ -20,10 +20,10 @@ TODO: Conditionally support 128-bit with intmax_t?
/////////////// Common.proto ///////////////
/////////////// Common.proto ///////////////
static
int
__Pyx_check_twos_complement
(
void
)
{
static
int
__Pyx_check_twos_complement
(
void
)
{
if
(
-
1
!=
~
0
)
{
if
(
(
-
1
!=
~
0
)
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"Two's complement required for overflow checks."
);
PyErr_SetString
(
PyExc_RuntimeError
,
"Two's complement required for overflow checks."
);
return
1
;
return
1
;
}
else
if
(
sizeof
(
short
)
==
sizeof
(
int
))
{
}
else
if
(
(
sizeof
(
short
)
==
sizeof
(
int
)
))
{
PyErr_SetString
(
PyExc_RuntimeError
,
"sizeof(short) < sizeof(int) required for overflow checks."
);
PyErr_SetString
(
PyExc_RuntimeError
,
"sizeof(short) < sizeof(int) required for overflow checks."
);
return
1
;
return
1
;
}
else
{
}
else
{
...
@@ -31,11 +31,11 @@ static int __Pyx_check_twos_complement(void) {
...
@@ -31,11 +31,11 @@ static int __Pyx_check_twos_complement(void) {
}
}
}
}
#define __PYX_IS_UNSIGNED(type) (((
type) -1) > 0
)
#define __PYX_IS_UNSIGNED(type) (((
(type) -1) > 0)
)
#define __PYX_SIGN_BIT(type) (((
unsigned type) 1) << (sizeof(type) * 8 - 1
))
#define __PYX_SIGN_BIT(type) (((
(unsigned type) 1) << (sizeof(type) * 8 - 1)
))
#define __PYX_HALF_MAX(type) (((
type) 1) << (sizeof(type) * 8 - 2
))
#define __PYX_HALF_MAX(type) (((
(type) 1) << (sizeof(type) * 8 - 2)
))
#define __PYX_MIN(type) (
__PYX_IS_UNSIGNED(type) ? (type) 0 : 0 - __PYX_HALF_MAX(type) - __PYX_HALF_MAX(type
))
#define __PYX_MIN(type) (
(__PYX_IS_UNSIGNED(type) ? (type) 0 : 0 - __PYX_HALF_MAX(type) - __PYX_HALF_MAX(type)
))
#define __PYX_MAX(type) (
~__PYX_MIN(type
))
#define __PYX_MAX(type) (
(~__PYX_MIN(type)
))
#define __Pyx_add_no_overflow(a, b, overflow) ((a) + (b))
#define __Pyx_add_no_overflow(a, b, overflow) ((a) + (b))
#define __Pyx_add_const_no_overflow(a, b, overflow) ((a) + (b))
#define __Pyx_add_const_no_overflow(a, b, overflow) ((a) + (b))
...
@@ -82,13 +82,13 @@ static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {
...
@@ -82,13 +82,13 @@ static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {
}
}
static
CYTHON_INLINE
{{
UINT
}}
__Pyx_mul_
{{
NAME
}}
_checking_overflow
({{
UINT
}}
a
,
{{
UINT
}}
b
,
int
*
overflow
)
{
static
CYTHON_INLINE
{{
UINT
}}
__Pyx_mul_
{{
NAME
}}
_checking_overflow
({{
UINT
}}
a
,
{{
UINT
}}
b
,
int
*
overflow
)
{
if
(
sizeof
({{
UINT
}})
<
sizeof
(
unsigned
long
))
{
if
(
(
sizeof
({{
UINT
}})
<
sizeof
(
unsigned
long
)
))
{
unsigned
long
big_r
=
((
unsigned
long
)
a
)
*
((
unsigned
long
)
b
);
unsigned
long
big_r
=
((
unsigned
long
)
a
)
*
((
unsigned
long
)
b
);
{{
UINT
}}
r
=
({{
UINT
}})
big_r
;
{{
UINT
}}
r
=
({{
UINT
}})
big_r
;
*
overflow
|=
big_r
!=
r
;
*
overflow
|=
big_r
!=
r
;
return
r
;
return
r
;
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
}
else
if
(
sizeof
({{
UINT
}})
<
sizeof
(
unsigned
PY_LONG_LONG
))
{
}
else
if
(
(
sizeof
({{
UINT
}})
<
sizeof
(
unsigned
PY_LONG_LONG
)
))
{
unsigned
PY_LONG_LONG
big_r
=
((
unsigned
PY_LONG_LONG
)
a
)
*
((
unsigned
PY_LONG_LONG
)
b
);
unsigned
PY_LONG_LONG
big_r
=
((
unsigned
PY_LONG_LONG
)
a
)
*
((
unsigned
PY_LONG_LONG
)
b
);
{{
UINT
}}
r
=
({{
UINT
}})
big_r
;
{{
UINT
}}
r
=
({{
UINT
}})
big_r
;
*
overflow
|=
big_r
!=
r
;
*
overflow
|=
big_r
!=
r
;
...
@@ -138,13 +138,13 @@ static CYTHON_INLINE {{INT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{INT}}
...
@@ -138,13 +138,13 @@ static CYTHON_INLINE {{INT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{INT}}
/////////////// BaseCaseSigned ///////////////
/////////////// BaseCaseSigned ///////////////
static
CYTHON_INLINE
{{
INT
}}
__Pyx_add_
{{
NAME
}}
_checking_overflow
({{
INT
}}
a
,
{{
INT
}}
b
,
int
*
overflow
)
{
static
CYTHON_INLINE
{{
INT
}}
__Pyx_add_
{{
NAME
}}
_checking_overflow
({{
INT
}}
a
,
{{
INT
}}
b
,
int
*
overflow
)
{
if
(
sizeof
({{
INT
}})
<
sizeof
(
long
))
{
if
(
(
sizeof
({{
INT
}})
<
sizeof
(
long
)
))
{
long
big_r
=
((
long
)
a
)
+
((
long
)
b
);
long
big_r
=
((
long
)
a
)
+
((
long
)
b
);
{{
INT
}}
r
=
({{
INT
}})
big_r
;
{{
INT
}}
r
=
({{
INT
}})
big_r
;
*
overflow
|=
big_r
!=
r
;
*
overflow
|=
big_r
!=
r
;
return
r
;
return
r
;
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
}
else
if
(
sizeof
({{
INT
}})
<
sizeof
(
PY_LONG_LONG
))
{
}
else
if
(
(
sizeof
({{
INT
}})
<
sizeof
(
PY_LONG_LONG
)
))
{
PY_LONG_LONG
big_r
=
((
PY_LONG_LONG
)
a
)
+
((
PY_LONG_LONG
)
b
);
PY_LONG_LONG
big_r
=
((
PY_LONG_LONG
)
a
)
+
((
PY_LONG_LONG
)
b
);
{{
INT
}}
r
=
({{
INT
}})
big_r
;
{{
INT
}}
r
=
({{
INT
}})
big_r
;
*
overflow
|=
big_r
!=
r
;
*
overflow
|=
big_r
!=
r
;
...
@@ -184,13 +184,13 @@ static CYTHON_INLINE {{INT}} __Pyx_sub_const_{{NAME}}_checking_overflow({{INT}}
...
@@ -184,13 +184,13 @@ static CYTHON_INLINE {{INT}} __Pyx_sub_const_{{NAME}}_checking_overflow({{INT}}
}
}
static
CYTHON_INLINE
{{
INT
}}
__Pyx_mul_
{{
NAME
}}
_checking_overflow
({{
INT
}}
a
,
{{
INT
}}
b
,
int
*
overflow
)
{
static
CYTHON_INLINE
{{
INT
}}
__Pyx_mul_
{{
NAME
}}
_checking_overflow
({{
INT
}}
a
,
{{
INT
}}
b
,
int
*
overflow
)
{
if
(
sizeof
({{
INT
}})
<
sizeof
(
long
))
{
if
(
(
sizeof
({{
INT
}})
<
sizeof
(
long
)
))
{
long
big_r
=
((
long
)
a
)
*
((
long
)
b
);
long
big_r
=
((
long
)
a
)
*
((
long
)
b
);
{{
INT
}}
r
=
({{
INT
}})
big_r
;
{{
INT
}}
r
=
({{
INT
}})
big_r
;
*
overflow
|=
big_r
!=
r
;
*
overflow
|=
big_r
!=
r
;
return
({{
INT
}})
r
;
return
({{
INT
}})
r
;
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
}
else
if
(
sizeof
({{
INT
}})
<
sizeof
(
PY_LONG_LONG
))
{
}
else
if
(
(
sizeof
({{
INT
}})
<
sizeof
(
PY_LONG_LONG
)
))
{
PY_LONG_LONG
big_r
=
((
PY_LONG_LONG
)
a
)
*
((
PY_LONG_LONG
)
b
);
PY_LONG_LONG
big_r
=
((
PY_LONG_LONG
)
a
)
*
((
PY_LONG_LONG
)
b
);
{{
INT
}}
r
=
({{
INT
}})
big_r
;
{{
INT
}}
r
=
({{
INT
}})
big_r
;
*
overflow
|=
big_r
!=
r
;
*
overflow
|=
big_r
!=
r
;
...
@@ -240,11 +240,11 @@ if (unlikely(__Pyx_check_sane_{{NAME}}())) {
...
@@ -240,11 +240,11 @@ if (unlikely(__Pyx_check_sane_{{NAME}}())) {
/////////////// SizeCheck.proto ///////////////
/////////////// SizeCheck.proto ///////////////
static
int
__Pyx_check_sane_
{{
NAME
}}(
void
)
{
static
int
__Pyx_check_sane_
{{
NAME
}}(
void
)
{
if
(
sizeof
({{
TYPE
}})
<=
sizeof
(
int
)
||
if
(
((
sizeof
({{
TYPE
}})
<=
sizeof
(
int
)
)
||
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
sizeof
({{
TYPE
}})
==
sizeof
(
PY_LONG_LONG
)
||
(
sizeof
({{
TYPE
}})
==
sizeof
(
PY_LONG_LONG
)
)
||
#endif
#endif
sizeof
({{
TYPE
}})
==
sizeof
(
long
))
{
(
sizeof
({{
TYPE
}})
==
sizeof
(
long
))
))
{
return
0
;
return
0
;
}
else
{
}
else
{
PyErr_Format
(
PyExc_RuntimeError
,
\
PyErr_Format
(
PyExc_RuntimeError
,
\
...
@@ -261,27 +261,27 @@ static CYTHON_INLINE {{TYPE}} __Pyx_{{BINOP}}_{{NAME}}_checking_overflow({{TYPE}
...
@@ -261,27 +261,27 @@ static CYTHON_INLINE {{TYPE}} __Pyx_{{BINOP}}_{{NAME}}_checking_overflow({{TYPE}
/////////////// Binop ///////////////
/////////////// Binop ///////////////
static
CYTHON_INLINE
{{
TYPE
}}
__Pyx_
{{
BINOP
}}
_
{{
NAME
}}
_checking_overflow
({{
TYPE
}}
a
,
{{
TYPE
}}
b
,
int
*
overflow
)
{
static
CYTHON_INLINE
{{
TYPE
}}
__Pyx_
{{
BINOP
}}
_
{{
NAME
}}
_checking_overflow
({{
TYPE
}}
a
,
{{
TYPE
}}
b
,
int
*
overflow
)
{
if
(
sizeof
({{
TYPE
}})
<
sizeof
(
int
))
{
if
(
(
sizeof
({{
TYPE
}})
<
sizeof
(
int
)
))
{
return
__Pyx_
{{
BINOP
}}
_no_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_no_overflow
(
a
,
b
,
overflow
);
}
else
if
(
__PYX_IS_UNSIGNED
({{
TYPE
}}))
{
}
else
if
(
__PYX_IS_UNSIGNED
({{
TYPE
}}))
{
if
(
sizeof
({{
TYPE
}})
==
sizeof
(
unsigned
int
))
{
if
(
(
sizeof
({{
TYPE
}})
==
sizeof
(
unsigned
int
)
))
{
return
__Pyx_
{{
BINOP
}}
_unsigned_int_checking_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_unsigned_int_checking_overflow
(
a
,
b
,
overflow
);
}
else
if
(
sizeof
({{
TYPE
}})
==
sizeof
(
unsigned
long
))
{
}
else
if
(
(
sizeof
({{
TYPE
}})
==
sizeof
(
unsigned
long
)
))
{
return
__Pyx_
{{
BINOP
}}
_unsigned_long_checking_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_unsigned_long_checking_overflow
(
a
,
b
,
overflow
);
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
}
else
if
(
sizeof
({{
TYPE
}})
==
sizeof
(
unsigned
PY_LONG_LONG
))
{
}
else
if
(
(
sizeof
({{
TYPE
}})
==
sizeof
(
unsigned
PY_LONG_LONG
)
))
{
return
__Pyx_
{{
BINOP
}}
_unsigned_long_long_checking_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_unsigned_long_long_checking_overflow
(
a
,
b
,
overflow
);
#endif
#endif
}
else
{
}
else
{
abort
();
return
0
;
/* handled elsewhere */
abort
();
return
0
;
/* handled elsewhere */
}
}
}
else
{
}
else
{
if
(
sizeof
({{
TYPE
}})
==
sizeof
(
int
))
{
if
(
(
sizeof
({{
TYPE
}})
==
sizeof
(
int
)
))
{
return
__Pyx_
{{
BINOP
}}
_int_checking_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_int_checking_overflow
(
a
,
b
,
overflow
);
}
else
if
(
sizeof
({{
TYPE
}})
==
sizeof
(
long
))
{
}
else
if
(
(
sizeof
({{
TYPE
}})
==
sizeof
(
long
)
))
{
return
__Pyx_
{{
BINOP
}}
_long_checking_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_long_checking_overflow
(
a
,
b
,
overflow
);
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
}
else
if
(
sizeof
({{
TYPE
}})
==
sizeof
(
PY_LONG_LONG
))
{
}
else
if
(
(
sizeof
({{
TYPE
}})
==
sizeof
(
PY_LONG_LONG
)
))
{
return
__Pyx_
{{
BINOP
}}
_long_long_checking_overflow
(
a
,
b
,
overflow
);
return
__Pyx_
{{
BINOP
}}
_long_long_checking_overflow
(
a
,
b
,
overflow
);
#endif
#endif
}
else
{
}
else
{
...
...
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