]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a compiler warning on Windows 64-bit in parsetok.c
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Nov 2013 00:09:51 +0000 (01:09 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Nov 2013 00:09:51 +0000 (01:09 +0100)
Python parser doesn't support lines longer than INT_MAX bytes yet

Parser/parsetok.c

index b4957b851269811fecc5e88577445495db171b4b..629dee565cd9266ad50e9f309252cfb6005261d5 100644 (file)
@@ -254,7 +254,8 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
         }
 #endif
         if (a >= tok->line_start)
-            col_offset = a - tok->line_start;
+            col_offset = Py_SAFE_DOWNCAST(a - tok->line_start,
+                                          Py_intptr_t, int);
         else
             col_offset = -1;