summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-09-15 22:48:09 (GMT)
committerGuido van Rossum <guido@python.org>1999-09-15 22:48:09 (GMT)
commit2174dcb06187098ceecad4e932ddfc95ffc36612 (patch)
tree1048bed882e106339413b40e16e6cc44b0dc4de3 /Python
parentf3c5f5c044376f96feebc6458f1212170b936d9a (diff)
downloadcpython-2174dcb06187098ceecad4e932ddfc95ffc36612.zip
cpython-2174dcb06187098ceecad4e932ddfc95ffc36612.tar.gz
cpython-2174dcb06187098ceecad4e932ddfc95ffc36612.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 1e937e4..e4e37d5 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3451,7 +3451,7 @@ PyCode_Addr2Line(co, addrq)
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) {