Fix HHBBC assertions with __LateInit
commite3bf416d3049de2a5ea5c6d1f6e4b7fab462eaef
authorRick Lavoie <rlavoie@fb.com>
Wed, 24 Apr 2019 16:15:26 +0000 (24 09:15 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 24 Apr 2019 16:19:38 +0000 (24 09:19 -0700)
tree79c38644e72775ce4c877957889acef69b2756f6
parentbcfe4e097b1bf2becf2292fd959df4f6c850cbd2
Fix HHBBC assertions with __LateInit

Summary:
Within HHBBC __LateInit props can have an inferred type of TBottom
depending on the order on which we evaluate the functions in the class (before
we see any sets to the prop). However, the member instruction analysis was not
particularly robust to TBottom and could result in assertions firing. Fix this
by disallowing the member instruction state to ever contain a TBottom type. As
soon as we obtain one, mark the instruction as unreachable. In the past we had
problems with unreachable() inside member instruction sequences, but it all
seems to work now.

Reviewed By: markw65

Differential Revision: D15060969

fbshipit-source-id: b779d9b48fa68c31f6e763ed60eff30944092db7
hphp/hhbbc/interp-minstr.cpp
hphp/test/slow/late-init/hhbbc-crash.php [new file with mode: 0644]
hphp/test/slow/late-init/hhbbc-crash.php.expect [new file with mode: 0644]
hphp/test/slow/late-init/hhbbc-crash.php.hphp_opts [new file with mode: 0644]
hphp/test/slow/late-init/hhbbc-crash.php.opts [new file with mode: 0644]