Skip to content
Unverified Commit 34415fd6 authored by Bruno Cardoso Lopes's avatar Bruno Cardoso Lopes Committed by GitHub
Browse files

[Clang][LLVM][Coroutines] Prevent __coro_gro from outliving __promise (#66706)

When dealing with short-circuiting coroutines (e.g. expected), the
deferred calls that resolve the get_return_object are currently being
emitted after we delete the coroutine frame.

This was caught by ASAN when using optimizations -O1 and above:
optimizations after inlining would place the __coro_gro in the heap, and
subsequent delete of the coroframe followed by the conversion -> BOOM.

This patch forbids the GRO to be placed in the coroutine frame, by
adding a new metadata node that can be attached to `alloca`
instructions.

Fix #49843 
parent c618e131
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment