mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
Disable optimiization of BN_num_bits_word() for VS2005 ARM compiler due to
its miscompilation of the function. https://mta.openssl.org/pipermail/openssl-users/2018-August/008465.html Reviewed-by: Mark J. Cox <mark@awe.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11526)
This commit is contained in:
parent
6c2a56beec
commit
7a09fab2b3
@ -88,6 +88,15 @@ const BIGNUM *BN_value_one(void)
|
||||
return &const_one;
|
||||
}
|
||||
|
||||
/*
|
||||
* Old Visual Studio ARM compiler miscompiles BN_num_bits_word()
|
||||
* https://mta.openssl.org/pipermail/openssl-users/2018-August/008465.html
|
||||
*/
|
||||
#if defined(_MSC_VER) && defined(_ARM_) && defined(_WIN32_WCE) \
|
||||
&& _MSC_VER>=1400 && _MSC_VER<1501
|
||||
# define MS_BROKEN_BN_num_bits_word
|
||||
# pragma optimize("", off)
|
||||
#endif
|
||||
int BN_num_bits_word(BN_ULONG l)
|
||||
{
|
||||
BN_ULONG x, mask;
|
||||
@ -132,6 +141,9 @@ int BN_num_bits_word(BN_ULONG l)
|
||||
|
||||
return bits;
|
||||
}
|
||||
#ifdef MS_BROKEN_BN_num_bits_word
|
||||
# pragma optimize("", on)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This function still leaks `a->dmax`: it's caller's responsibility to
|
||||
|
Loading…
Reference in New Issue
Block a user