This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author twouters
Recipients gregory.p.smith, twouters
Date 2021-07-21.15:06:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.
Date User Action Args
2021-07-21 15:06:49twouterssetrecipients: + twouters, gregory.p.smith
2021-07-21 15:06:49twouterssetmessageid: <>
2021-07-21 15:06:49twouterslinkissue44698 messages
2021-07-21 15:06:49twouterscreate