File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -544,7 +544,7 @@ int64_t CPyInt64_Divide(int64_t x, int64_t y) {
544
544
PyErr_SetString (PyExc_ZeroDivisionError , "integer division or modulo by zero" );
545
545
return CPY_LL_INT_ERROR ;
546
546
}
547
- if (y == -1 && x == -1LL << 63 ) {
547
+ if (y == -1 && x == INT64_MIN ) {
548
548
PyErr_SetString (PyExc_OverflowError , "integer division overflow" );
549
549
return CPY_LL_INT_ERROR ;
550
550
}
@@ -562,7 +562,7 @@ int64_t CPyInt64_Remainder(int64_t x, int64_t y) {
562
562
return CPY_LL_INT_ERROR ;
563
563
}
564
564
// Edge case: avoid core dump
565
- if (y == -1 && x == -1LL << 63 ) {
565
+ if (y == -1 && x == INT64_MIN ) {
566
566
return 0 ;
567
567
}
568
568
int64_t d = x % y ;
@@ -607,7 +607,7 @@ int32_t CPyInt32_Divide(int32_t x, int32_t y) {
607
607
PyErr_SetString (PyExc_ZeroDivisionError , "integer division or modulo by zero" );
608
608
return CPY_LL_INT_ERROR ;
609
609
}
610
- if (y == -1 && x == -1LL << 31 ) {
610
+ if (y == -1 && x == INT32_MIN ) {
611
611
PyErr_SetString (PyExc_OverflowError , "integer division overflow" );
612
612
return CPY_LL_INT_ERROR ;
613
613
}
@@ -625,7 +625,7 @@ int32_t CPyInt32_Remainder(int32_t x, int32_t y) {
625
625
return CPY_LL_INT_ERROR ;
626
626
}
627
627
// Edge case: avoid core dump
628
- if (y == -1 && x == -1LL << 31 ) {
628
+ if (y == -1 && x == INT32_MIN ) {
629
629
return 0 ;
630
630
}
631
631
int32_t d = x % y ;
You can’t perform that action at this time.
0 commit comments