Skip to content

Assertion failure in operator delete of llvm::User #129900

@marcauberer

Description

@marcauberer

Commit e3f936e introduces a functional regression. If the constructor after operator new fails, and then operator delete is called, we run into the following assertion. This was caught by malfunction tests:

https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/User.cpp#L190

Reverting the removal of:

Obj->NumUserOperands = Us;
Obj->HasHungOffUses = false;
Obj->HasDescriptor = DescBytes != 0;

respecively

Obj->NumUserOperands = 0;
Obj->HasHungOffUses = true;
Obj->HasDescriptor = false;

helps.

I will prepare a patch for that.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions