forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix phpGH-10251: Assertion `(flag & (1<<3)) == 0' failed.
zend_get_property_guard previously assumed that at least "str" has a pre-computed hash. This is not always the case, for example when a string is created by bitwise operations, its hash is not set. Instead of forcing a computation of the hashes, drop the hash comparison. Closes phpGH-10254 Co-authored-by: Changochen <[email protected]> Signed-off-by: George Peter Banyard <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 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,24 @@ | ||
--TEST-- | ||
GH-10251 (Assertion `(flag & (1<<3)) == 0' failed.) | ||
--FILE-- | ||
<?php | ||
class A | ||
{ | ||
function __set($o, $l) | ||
{ | ||
$this->$p = $v; | ||
} | ||
} | ||
$a = new A(); | ||
$pp = ""; | ||
$op = $pp & ""; | ||
// Bitwise operators on strings don't compute the hash. | ||
// The code below previously assumed a hash was actually computed, leading to a crash. | ||
$a->$op = 0; | ||
echo "Done\n"; | ||
?> | ||
--EXPECTF-- | ||
Warning: Undefined variable $v in %s on line %d | ||
|
||
Warning: Undefined variable $p in %s on line %d | ||
Done |
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