Skip to content
Unverified Commit 1fad78b1 authored by Yuxuan Chen's avatar Yuxuan Chen Committed by GitHub
Browse files

[Clang][Coroutines] Properly emit EH code for initial suspend `await_resume` (#73073)

This change aims to fix an ICE in issue
https://github.com/llvm/llvm-project/issues/63803

The crash happens in `ExitCXXTryStmt` because `EmitAnyExpr()` adds
additional cleanup to the `EHScopeStack`. This messes up the assumption
in `ExitCXXTryStmt` that the top of the stack should be a
`EHCatchScope`.

However, since we never read a value returned from `await_resume()` of
an init suspend, we can skip the part that builds this `RValue`.

The code here may not be in the best shape. There's another bug that
`memberCallExpressionCanThrow` doesn't work on the current Expr due to
type mismatch. I am preparing a separate PR to address it plus some
refactoring might be beneficial.
parent 2c875719
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment