Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2174dcb

Browse files
committed
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.
1 parent f3c5f5c commit 2174dcb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3451,7 +3451,7 @@ PyCode_Addr2Line(co, addrq)
34513451
int addrq;
34523452
{
34533453
int size = PyString_Size(co->co_lnotab) / 2;
3454-
char *p = PyString_AsString(co->co_lnotab);
3454+
unsigned char *p = (unsigned char*)PyString_AsString(co->co_lnotab);
34553455
int line = co->co_firstlineno;
34563456
int addr = 0;
34573457
while (--size >= 0) {

0 commit comments

Comments
 (0)