Fix HHBBC constprop during inline interpretation
Summary:
If HHBBC performs a constprop during inline function interpretation,
we can derive incorrect results. The analysis assumes that if we
perform a constprop, the bytecode will actually be replaced, and
therefore we can use the inferred type afterwards (usually a static
array). However, if we're in inline interp, the bytecode won't
actually be changed (the types are contextual), which means the actual
runtime type won't be static.
For example, suppose we have NewKeysetArray with constant inputs,
coming from the function's parameters. Normally we would constprop
this to a static keyset using the Keyset bytecode. However since we're
in inline interp, and the constant inputs are coming from the
function's parameters, the inputs to NewKeysetArray won't actually be
constant at runtime. So it is not correct to derive a static type.
Fix this by not performing constprop if we're in inline interp. We'll
still push a constant type, but it won't be converted to a static
array.
Reviewed By: jano
Differential Revision:
D24821589
fbshipit-source-id:
e3ccf21e55d417c8ec1e126acceb2c09896635f7