Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-8778: Integer arithmethic with large number variants fails
When casting a `variant` to `int`, we need to heed the proper `zval` type, which is an signed 64bit integer on x64, while `VT_INT` is only a signed 32bit integer. Closes GH-8779.
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Bug GH-8778 (Integer arithmethic with large number variants fails) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded("com_dotnet")) die("skip com_dotnet extension not available"); | ||
if (PHP_INT_SIZE < 8) die("skip for 64bit only"); | ||
?> | ||
--FILE-- | ||
<?php | ||
$int = 0x100000000; | ||
var_dump( | ||
$int, | ||
new variant($int) + 1 | ||
); | ||
?> | ||
--EXPECT-- | ||
int(4294967296) | ||
int(4294967297) |