Skip to content

Commit

Permalink
Unregister a hyperobject field before calling its destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
VoxSciurorum authored and neboat committed Nov 5, 2024
1 parent 62711b5 commit d6e5ee0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/lib/CodeGen/CGClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,11 @@ namespace {
LValue LV = CGF.EmitLValueForField(ThisLV, field);
assert(LV.isSimple());

if (field->getType()->isHyperobjectType()) {
llvm::Function *F =
CGF.CGM.getIntrinsic(llvm::Intrinsic::reducer_unregister);
CGF.Builder.CreateCall(F, {LV.getPointer(CGF)});
}
CGF.emitDestroy(LV.getAddress(CGF), field->getType(), destroyer,
flags.isForNormalCleanup() && useEHCleanupForArray);
}
Expand Down

0 comments on commit d6e5ee0

Please sign in to comment.