[PATCH] ntdll: Initialize StatusWord and TagWord in i386 init_thread_context.

Jefferson Carpenter jeffersoncarpenter2 at gmail.com
Fri Jul 3 04:50:27 CDT 2020


I will look into this.  Zeroing the entire thing in this function clears 
up the valgrind warning (this could be a valgrind bug).  However at 
least setting TagWord is a correction that sets the FPU to the correct 
state (all floats empty).

On 7/3/2020 9:47 AM, Alexandre Julliard wrote:
> Jefferson Carpenter <jeffersoncarpenter2 at gmail.com> writes:
> 
>> @@ -2270,7 +2270,11 @@ static void init_thread_context( CONTEXT *context, LPTHREAD_START_ROUTINE entry,
>>       context->Esp    = (DWORD)NtCurrentTeb()->Tib.StackBase - 16;
>>       context->Eip    = (DWORD)relay;
>>       context->FloatSave.ControlWord = 0x27f;
>> +    context->FloatSave.StatusWord  = 0;
>> +    context->FloatSave.TagWord     = 0xffff;
>>       ((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->ControlWord = 0x27f;
>> +    ((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->StatusWord  = 0;
>> +    ((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->TagWord     = 0;
>>       ((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->MxCsr = 0x1f80;
> 
> The entire context is already initialized to 0, this shouldn't be
> necessary.
> 



More information about the wine-devel mailing list