-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: Fix incorrect elimination of type store
Fixes oss-fuzz #41995
- Loading branch information
Showing
2 changed files
with
35 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
JIT MUL: 008 incorrect elimination of type store | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.file_update_protection=0 | ||
opcache.jit_buffer_size=1M | ||
opcache.protect_memory=1 | ||
--SKIPIF-- | ||
<?php if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?> | ||
--FILE-- | ||
<?php | ||
function foo(int $a){ | ||
$a=$a%10; | ||
$a=$f=$a*(6158978401740); | ||
$a=$f=$a*(261740); | ||
$a%0; | ||
} | ||
foo(3); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smul_008.php:6 | ||
Stack trace: | ||
#0 %smul_008.php(8): foo(%d) | ||
#1 {main} | ||
thrown in %smul_008.php on line 6 |