diff Python/compile.c @ 11290:ccdf5dc2acf6 legacy-trunk

Tim Peters writes: For a long time I've seen absurd tracebacks under -O (e.g., negative line numbers), but very rarely. Since I was looking at tracebacks anyway, thought I'd track it down. Turns out to be Guido's only predictable blind spot <wink -- "char" is signed on some non-GvR systems>. Patch follows.
author Guido van Rossum <guido@python.org>
date Wed, 15 Sep 1999 22:48:09 +0000
parents b7bcc2cda1b3
children 770618d9a7fc
line wrap: on
line diff
--- a/Python/compile.c	Wed Sep 15 22:15:23 1999 +0000
+++ b/Python/compile.c	Wed Sep 15 22:48:09 1999 +0000
@@ -3451,7 +3451,7 @@
 	int addrq;
 {
 	int size = PyString_Size(co->co_lnotab) / 2;
-	char *p = PyString_AsString(co->co_lnotab);
+	unsigned char *p = (unsigned char*)PyString_AsString(co->co_lnotab);
 	int line = co->co_firstlineno;
 	int addr = 0;
 	while (--size >= 0) {