Commit 8efe4743 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.25.x'

parents 0ed6a47d afeb193f
...@@ -596,7 +596,7 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO ...@@ -596,7 +596,7 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO
} }
return PyInt_FromLong(x); return PyInt_FromLong(x);
{{elif op == 'Lshift'}} {{elif op == 'Lshift'}}
if (likely(a == (a << b) >> b)) { if (likely(b < sizeof(long)*8 && a == (a << b) >> b) || !a) {
return PyInt_FromLong(a {{c_op}} b); return PyInt_FromLong(a {{c_op}} b);
} }
{{else}} {{else}}
...@@ -685,12 +685,12 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO ...@@ -685,12 +685,12 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO
x = a {{c_op}} b; x = a {{c_op}} b;
{{if op == 'Lshift'}} {{if op == 'Lshift'}}
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
if (unlikely(a != x >> b)) { if (unlikely(!(b < sizeof(long)*8 && a == x >> b)) && a) {
ll{{ival}} = {{ival}}; ll{{ival}} = {{ival}};
goto long_long; goto long_long;
} }
#else #else
if (likely(a == x >> b)) /* execute return statement below */ if (likely(b < sizeof(long)*8 && a == x >> b) || !a) /* execute return statement below */
#endif #endif
{{endif}} {{endif}}
{{endif}} {{endif}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment