This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Cast to _Unwind_Exception_Class when setting exc.exception_class
On Tue, Sep 18, 2012 at 2:50 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Sep 18, 2012 at 2:12 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> The x86_64 THREAD_SETMEM casts its third argument to uint64_t when the
>> field is 64 bits wide. So how does a problem arise in practice?
>>
>
> We need to add cast to i386 THREAD_SETMEM.
>
Like this. OK to install?
Thanks.
--
H.J.
---
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index ab42708..38f439b 100644
--- a/nptl/sysdeps/i386/tls.h
+++ b/nptl/sysdeps/i386/tls.h
@@ -343,7 +343,7 @@ union user_desc_init
\
asm volatile ("movl %%eax,%%gs:%P1\n\t" \
"movl %%edx,%%gs:%P2" : \
- : "A" (value), \
+ : "A" ((uint64_t) value), \
"i" (offsetof (struct pthread, member)), \
"i" (offsetof (struct pthread, member) + 4)); \
}})
@@ -370,7 +370,7 @@ union user_desc_init
\
asm volatile ("movl %%eax,%%gs:%P1(,%2,8)\n\t" \
"movl %%edx,%%gs:4+%P1(,%2,8)" : \
- : "A" (value), \
+ : "A" ((uint64_t) value), \
"i" (offsetof (struct pthread, member)), \
"r" (idx)); \
}})