Author twouters
Recipients gregory.p.smith, twouters
Date 2021-07-21.15:06:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org>
In-reply-to
Content
Objects/complexobject.c's complex_pow uses undefined behaviour, by casting a float of unknown magnitude to a long:

    int_exponent = (long)exponent.real;

At Google we build with clang and -fsanitize=float-cast-overflow by default, which catches this particular kind of undefined behaviour. We didn't notice, however, because the only code we've come across that exercises this behaviour was a commented-out test in test_complex, which was uncommented in 3.8. Running the test, or just '1e19+1j ** 1e19', is enough to trigger the undefined behaviour. I'll prepare a PR to fix it.
History
Date User Action Args
2021-07-21 15:06:49twouterssetrecipients: + twouters, gregory.p.smith
2021-07-21 15:06:49twouterssetmessageid: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org>
2021-07-21 15:06:49twouterslinkissue44698 messages
2021-07-21 15:06:49twouterscreate