Avoid signed overflow in MSVC AMR64 secp256k1_mul128

This commit is contained in:
Pieter Wuille 2022-11-17 09:44:10 -05:00
parent 9b5f589d30
commit 3afce0af7c
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ static SECP256K1_INLINE uint64_t secp256k1_umul128(uint64_t a, uint64_t b, uint6
static SECP256K1_INLINE int64_t secp256k1_mul128(int64_t a, int64_t b, int64_t* hi) {
*hi = __mulh(a, b);
return a * b;
return (uint64_t)a * (uint64_t)b;
}
# else
/* On x84_64 MSVC, use native _(u)mul128 for 64x64->128 multiplications. */