Issue #15989: Fixed some scarcely probable integer overflows.
It is very unlikely that they can occur in real code for now.
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 8a2dc7c..fd7f17e 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -769,7 +769,7 @@
         return 1;
     }
 
-    i = (int)PyLong_AsLong(obj);
+    i = _PyLong_AsInt(obj);
     if (i == -1 && PyErr_Occurred())
         return 1;
     *out = i;