fix ref count bug in unserializer
commitb64ac9106b3ebf5b00b3c15e77443f48a9cb96e0
authorSally Zhou <sallyz@fb.com>
Tue, 16 Aug 2022 21:08:14 +0000 (16 14:08 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 16 Aug 2022 21:08:14 +0000 (16 14:08 -0700)
treedbe8722695352c1e93c1b0c5d0aec32192296e96
parentd5f26bd55ddea1c2bccc211e1587970e7925a722
fix ref count bug in unserializer

Summary:
* Use `Resolution&&` in HHBBC to match the existing `Builder::finish()` method
* In unserializer, reassign `arr` to the new bespoke type struct instead of just resetting. This way, the old dict will be automatically decref-ed and the new one won't be incref-ed again. This was causing a memory regression in Swayze.

Reviewed By: paulbiss

Differential Revision: D38725009

fbshipit-source-id: d04ead591ab8ed609ea78c888423793e963df649
hphp/hhbbc/type-structure.cpp
hphp/runtime/base/variable-unserializer.cpp