mirror of https://github.com/php/php-src
Browse Source
If a class is extended after the constant fetch has been cached the cached value will be turned into a reference. On the next fetch the polymorphic cache will return this reference, which will be directly returned. The object assignment code then dereferences this result and performs a shallow copy, which is invalid for references. This subsequently leads to the constant value being prematurely freed. This is fixed by dereferencing the value returned from the polymorphic cache. Furthermore the incorrect dereference from in the object assignment code is replaced with an assertion that we're dealing with a non-reference, so ensure that this kind of problem cannot go unnoticed in the future.pull/686/head
4 changed files with 40 additions and 13 deletions
Loading…
Reference in new issue