Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
4.6.3, 4.7.0
-
None
Description
in file src/corelib/arch/x86_64/qatomic_sun.s, q_atomic_decrement and q_atomic_increment only update register '%al', and leave other 24 bit of %eax unchanged. But these 2 functions are declared as return int value.
If the high 24 bits of %eax is not zero, the caller will not get the expected return value.
Patch suggestion (from an external customer):
--- qt_main/src/corelib/arch/x86_64/qatomic_sun.s-orig 2010-07-08 19:33:03.880000000 -0700 +++ qt_main/src/corelib/arch/x86_64/qatomic_sun.s 2010-07-08 19:32:09.380000000 -0700 @@ -7,6 +7,7 @@ q_atomic_increment: lock incl (%rdi) + mov $0,%eax setne %al ret .size q_atomic_increment,.-q_atomic_increment @@ -18,6 +19,7 @@ q_atomic_decrement: lock decl (%rdi) + mov $0,%eax setne %al ret .size q_atomic_decrement,.-q_atomic_decrement