xquartz dereferencing a NULL pointer (patch 2)

Tiago Vignatti vignatti at c3sl.ufpr.br
Thu Nov 6 19:48:34 PST 2008


Simon Thum escreveu:
>> newtail = (oldtail + 1) % QUEUE_SIZE; 
>> miEventQueue.tail = newtail;
>>
>> becoming
>>
>> miEventQueue.tail++;
>> miEventQueue.tail |= QUEUE_SIZE - 1;
> I don't think a compiler should be doing this to a non-local store. It
> could probably be considered a bug. C doesn't really have a memory model
> but few rules likely to forbid this. I didn't check, but I'd be highly
> surprised by this being legal. Do you have a case where it happens?

http://www.nongnu.org/avr-libc/user-manual/group__util__atomic.html

Does we have this kind of thing in C libraries? It would be useful.


Cheers,

-- 
Tiago Vignatti
C3SL - Centro de Computação Científica e Software Livre
www.c3sl.ufpr.br



More information about the xorg mailing list