-
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.
The analysis in the bug report wasn't correct (at least not in this case -- there may still be a more general problem here), the issue was that write_property returned the original variable_ptr rather than the zend_assign_to_variable() return value, which will DEREF the variable before overwriting it.
- Loading branch information
Showing
3 changed files
with
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--TEST-- | ||
Using return of property assignment to reference that destroys object | ||
--FILE-- | ||
<?php | ||
|
||
$a = new stdClass; | ||
$a->a =& $a; | ||
var_dump($a->a = 0); | ||
|
||
?> | ||
--EXPECT-- | ||
int(0) |
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