================ @@ -395,27 +395,27 @@ namespace { void CodeGenFunction::EmitAnyExprToExn(const Expr *e, Address addr) { // Make sure the exception object is cleaned up if there's an // exception during initialization. - pushFullExprCleanup<FreeException>(EHCleanup, addr.getPointer()); - EHScopeStack::stable_iterator cleanup = EHStack.stable_begin(); - - // __cxa_allocate_exception returns a void*; we need to cast this - // to the appropriate type for the object. - llvm::Type *ty = ConvertTypeForMem(e->getType()); - Address typedAddr = addr.withElementType(ty); - - // FIXME: this isn't quite right! If there's a final unelided call - // to a copy constructor, then according to [except.terminate]p1 we - // must call std::terminate() if that constructor throws, because - // technically that copy occurs after the exception expression is - // evaluated but before the exception is caught. But the best way - // to handle that is to teach EmitAggExpr to do the final copy - // differently if it can't be elided. - EmitAnyExprToMem(e, typedAddr, e->getType().getQualifiers(), - /*IsInit*/ true); - - // Deactivate the cleanup block. - DeactivateCleanupBlock(cleanup, - cast<llvm::Instruction>(typedAddr.getPointer())); + pushFullExprCleanup<FreeException>(EHCleanup, addr.getRawPointer(*this)); ---------------- efriedma-quic wrote:
The new indentation here doesn't look right? https://github.com/llvm/llvm-project/pull/67454 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits