[PATCH] fix KJS crash on some more strict platforms

Helge Deller deller at gmx.de
Tue Dec 16 23:53:30 GMT 2003

On Wednesday 17 December 2003 00:41, Helge Deller wrote:
>So, the code above will work as expected. However, this code might not: 
>....[example stripped]
> And this is exactly what my proposed patch is about. We try to read a double
> from the pointer which is &char[8] and this is not guaranteed to work:
> const double NaN = *(const double*) NaN_Bytes;

.... at least since NaN_Bytes (remember, it's not in a union right now!) is 
not guaranteed to have been 8-byte aligned by the compiler which a 
double needs to be on e.g. the hppa platform. (As another example I think 
e.g. IA64 would not crash but might introduce extra wait/load cycles)
As the manpage says: It might work, but does not need to.

More information about the kde-core-devel mailing list