From 515640c3e550c0943bc2bb6e414f501c6c6aabd6 Mon Sep 17 00:00:00 2001 From: Gary Date: Fri, 22 Nov 2024 14:34:24 +0000 Subject: [PATCH 1/2] Add test for bug GH-16870 (Overly restrictive gmp_pow overflow checks) --- ext/gmp/tests/gh16870.phpt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ext/gmp/tests/gh16870.phpt diff --git a/ext/gmp/tests/gh16870.phpt b/ext/gmp/tests/gh16870.phpt new file mode 100644 index 0000000000000..ef0ff80856673 --- /dev/null +++ b/ext/gmp/tests/gh16870.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug GH-16870 (Overly restrictive gmp_pow overflow checks) +--EXTENSIONS-- +gmp +--FILE-- + +--EXPECT-- +64^11 = 0x40000000000000000 +2^31 = 0x80000000 +2^32 = 0x100000000 +2^64 = 0x10000000000000000 +2^128 = 0x100000000000000000000000000000000 +2^512 = 0x100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +2^1024 = 0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +2^8192 = 0x100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 From 52e504f63caa3f343cbd0c50f650fbafeb6e8b4b Mon Sep 17 00:00:00 2001 From: GaryAllan Date: Fri, 22 Nov 2024 16:18:55 +0000 Subject: [PATCH 2/2] Update ext/gmp/tests/gh16870.phpt Add XFAIL header for CI Co-authored-by: Gina Peter Banyard --- ext/gmp/tests/gh16870.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/gmp/tests/gh16870.phpt b/ext/gmp/tests/gh16870.phpt index ef0ff80856673..2cdbc44f3f1ac 100644 --- a/ext/gmp/tests/gh16870.phpt +++ b/ext/gmp/tests/gh16870.phpt @@ -2,6 +2,8 @@ Bug GH-16870 (Overly restrictive gmp_pow overflow checks) --EXTENSIONS-- gmp +--XFAIL-- +Currently fails after the introduction of overflow warning --FILE--