Get rid of most remaining internal is_array checks
commitf400310f1082898ae924fa68f24bcec8bca17da8
authorShaunak Kishore <kshaunak@fb.com>
Thu, 16 Jul 2020 03:25:37 +0000 (15 20:25 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 16 Jul 2020 03:27:55 +0000 (15 20:27 -0700)
tree442afb0fbe4e8b8997976b022e914dea8273104e
parentc5b22050b966a206996321f26556a3f9f9649aa8
Get rid of most remaining internal is_array checks

Summary:
A small grab-bag of places where we should replace isArrayType / tvIsArray checks with HAM-safe helpers instead.

We need to make an argument about safety at each point, which I'll do inline. There are a few places that I didn't change because I couldn't provide a good reasoning - we may need logging for those. In particular, there's an ext_soap function where I can't prove that it doesn't get a varray, and the array_slice builtin does manual intish-casting logic for some reason.

Reviewed By: ricklavoie

Differential Revision: D22556563

fbshipit-source-id: e80f17766bb7e46c1d8a2fce79d31c5ecadc25f3
13 files changed:
hphp/runtime/base/backtrace.cpp
hphp/runtime/base/object-data.cpp
hphp/runtime/base/struct-log-util.cpp
hphp/runtime/base/tv-type.h
hphp/runtime/base/type-structure-helpers-defs.h
hphp/runtime/base/type-variant.h
hphp/runtime/base/variable-serializer.cpp
hphp/runtime/ext/array/ext_array.cpp
hphp/runtime/ext/simplexml/ext_simplexml.cpp
hphp/runtime/ext/simplexml/ext_simplexml.h
hphp/runtime/ext/soap/encoding.cpp
hphp/runtime/vm/type-alias.h
hphp/runtime/vm/type-constraint.cpp