Fix frame-state processing of CallBuiltin for non-inlined NativeImpls
Summary:
Frame-state has logic to deal with CallBuiltin writing to out
parameters. However this is broken for a CallBuiltin arising from a
non-inlined NativeImpl. It modifies the stack slots that should
correspond to the out parameters, but if the NativeImpl hasn't been
inlined, those slots are in the caller, and not tracked by
frame-state. We end up modifying some unrelated stack slots. The
reason why this hasn't been a problem until now is that the bogus
stack slots always corresponded to where the locals were, and thus
weren't used otherwise. There was always enough space occupied by
these locals to cover all the stack slots.
However, now that locals might be compressed, there might not be
enough space, and frame-state will attempt to modify beyond the end of
the stack, triggering asserts. Fix this by only recording the relevant
metadata in the case where the out parameter slots actually exist in
the unit. Frame-state will only make the relevant changes in the
appropriate situation.
Reviewed By: jano
Differential Revision:
D20938688
fbshipit-source-id:
8bfbf84b9cc468335009f0d4ed20a81df90715ad