Collect XHP attribute ancestors when exporting decls
commitb936f3f4b7642c1a1d5ce160011e22700229f4ae
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Wed, 30 Jan 2019 07:10:04 +0000 (29 23:10 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 30 Jan 2019 07:14:31 +0000 (29 23:14 -0800)
tree69b5a727d12a1aa36ab4757a8b0e09af346445f8
parent7b45dcfedda29bbdebe61545daeb4c48ab4f5f0a
Collect XHP attribute ancestors when exporting decls

Summary:
It looks like T39730034 was caused by failing to store all ancestors of hot classes whose decls we store in the saved state. When exporting declarations, we store all ancestors in the dc_ancestors collection on each hot class. This collection includes parents, interfaces and traits, but does not include XHP classes whose attributes are used by the hot class--those ancestors are stored in dc_xhp_attr_deps. This means that we fail to store the types of XHP attributes inherited via an XHP-attribute-use, resulting in raising Decl_heap_elems_bug when we attempt to use the hot class which had a cold XHP-attribute-use ancestor. Evidently, we did not have any hot classes which used the XHP-attribute-inclusion feature on a cold class until this morning.

The fix is straightforward--we just need to store xhp_attr_deps ancestors in addition to dc_ancestors.

Reviewed By: 2BitSalute

Differential Revision: D13870852

fbshipit-source-id: 27b9d81ce5a11381f0531ae3576b9258e5d1a7e7
hphp/hack/src/decl/decl_export.ml