Sema: fix coerce_result_ptr in case of inferred result type

Previously, the logic for analyzing coerce_result_ptr would generate
invalid bitcast instructions which did not include coercion logic, such
as optional wrapping, resulting in miscompilations.

Now, the logic of resolve_inferred_alloc goes back over all the
placeholders inserted by coerce_result_ptr, and replaces them with logic
doing the proper coercions.

Closes #12045
667ad9250fAndrew Kelley committed on 7/14/2022, 11:48:44 PMparent1653a9b
3 files changedLine totals unavailable