Le 19/05/2013 08:55, Václav Zeman a écrit :
> On 19 May 2013 05:17, dw <limegreenso...@yahoo.com> wrote:
>> There is a bug in __stosb (as well as the other __stos* functions), as
>> illustrated by this code (compile with -Os for 64bit):
>>
>> #include <stdio.h>
>> #include <windows.h>
>>
>> #ifndef _AMD64_
>> #error Must be compiled for 64 bit
>> #endif
>>
>> int main(int argc, char* argv[])
>> {
>>   struct
>>   {
>>     int a;
>>     int b;
>>   } c;
>>
>>   c.a = 1;
>>   c.b = 2;
>>
>>   __stosb((PBYTE)&c, 0, sizeof(c));
>>   printf("%u %u\n", c.a, c.b); // Should print 0 0
>> }
>>
>> The attached patch resolves this issue.

> What bug is it? It is not obvious from just the diff.

"memory" clobber is missing (I agree that this is not obvious!)

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to