-
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 ASSIGN_DIM_OP with undefined variable and index and user err…
…or handler, throwing an exception Fixes oss-fuzz #39422
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 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,32 @@ | ||
--TEST-- | ||
JIT ASSIGN_DIM_OP: Undefined variable and index with exception | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.file_update_protection=0 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
set_error_handler(function($_, $m){ | ||
throw new Exception($m); | ||
}); | ||
function test1() { | ||
$res = $a[$undef] = null; | ||
} | ||
function test2() { | ||
$res = $a[$undef] += 1; | ||
} | ||
try { | ||
test1(); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
try { | ||
test2(); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
?> | ||
--EXPECT-- | ||
Undefined variable $undef | ||
Undefined variable $a |