Don't COW dynamic properties array when reading dynamic property.
commitaa948fb114126df993603128208f3699bd8c45c9
authorAlexey Toptygin <alexeyt@fb.com>
Sat, 2 Sep 2017 01:15:33 +0000 (1 18:15 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sat, 2 Sep 2017 01:31:24 +0000 (1 18:31 -0700)
tree5240abdfdc6053bfe0dd4bb5d15fa4a0098fb196
parent8f4c8740cf66278109480168d25978842e9a1d7f
Don't COW dynamic properties array when reading dynamic property.

Summary:
While working on propImpl, I noticed that it uses getProp on a non-const ObjectData, which will unconditionally pass the COW flag to getPropImpl. This is the wrong behavior when we're reading (MOpMode::None and MOpMode::Warn). Add a unit test that demonstrates the problem, and fix it by calling getPropImpl directly and passing the correct value for the COW bit.
FWIW, our behavior did not agree with either PHP5 or PHP7. We will now agree with PHP7. Write: https://3v4l.org/mKWaX read: https://3v4l.org/0kDPh control (no operation on object): https://3v4l.org/EBGQf

Reviewed By: markw65

Differential Revision: D5758132

fbshipit-source-id: 7dd68142ca44283c1edd841ef61b70025af6faf4
hphp/runtime/base/object-data.cpp
hphp/test/slow/object_property/dynprop_cow.php [new file with mode: 0644]
hphp/test/slow/object_property/dynprop_cow.php.expect [new file with mode: 0644]