tst_qlocale: only restore the fp control masks we change

Certain masks are not supported outside 32-bit x86, and will assert on
x64.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-106000
Change-Id: Ic9f58e5a19c1db3309edeb5ec529e7a78c929665
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Mårten Nordheim 2022-08-29 14:58:50 +02:00
parent 8bada697d6
commit 070446d5eb

View File

@ -1495,8 +1495,7 @@ void tst_QLocale::fpExceptions()
# define _EM_INEXACT 0x00000001
# endif
_clearfp();
unsigned int oldbits = _controlfp(0, 0);
_controlfp( 0 | _EM_INEXACT, _MCW_EM );
unsigned int oldbits = _controlfp(0 | _EM_INEXACT, _MCW_EM);
#endif
#ifdef QT_USE_FENV
@ -1514,7 +1513,7 @@ void tst_QLocale::fpExceptions()
#ifdef Q_OS_WIN
_clearfp();
_controlfp(oldbits, 0xFFFFF);
_controlfp(oldbits, _MCW_EM);
#endif
#ifdef QT_USE_FENV