This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Nickolai.Zeldovich
Recipients Nickolai.Zeldovich, ezio.melotti, mark.dickinson, mrabarnett, serhiy.storchaka
Date 2013-01-23.16:56:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358960195.58.0.175127037544.issue17016@psf.upfronthosting.co.za>
In-reply-to
Content
Lines 2777 and 3111 do indeed look suspect, because gcc can compile (ptr + offset < ptr) into (offset < 0):

nickolai@sahara:/tmp$ cat x.c 
void bar();

void
foo(char* ptr, int offset)
{
  if (ptr + offset < ptr)
    bar();
}
nickolai@sahara:/tmp$ gcc x.c -S -o - -O2
...
foo:
.LFB0:
	.cfi_startproc
	testl	%esi, %esi
	js	.L4
	rep
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	jmp	bar
	.cfi_endproc
...
nickolai@sahara:/tmp$ 

Lines 658, 678, 1000, 1084 are potentially problematic -- I don't know of current compilers that will do something unexpected, but it might be worth rewriting the code to avoid undefined behavior anyway.
History
Date User Action Args
2013-01-23 16:56:35Nickolai.Zeldovichsetrecipients: + Nickolai.Zeldovich, mark.dickinson, ezio.melotti, mrabarnett, serhiy.storchaka
2013-01-23 16:56:35Nickolai.Zeldovichsetmessageid: <1358960195.58.0.175127037544.issue17016@psf.upfronthosting.co.za>
2013-01-23 16:56:35Nickolai.Zeldovichlinkissue17016 messages
2013-01-23 16:56:35Nickolai.Zeldovichcreate