aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/User.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/User.cpp')
-rw-r--r--lib/VMCore/User.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/VMCore/User.cpp b/lib/VMCore/User.cpp
index ba2b2081db..2f4587debb 100644
--- a/lib/VMCore/User.cpp
+++ b/lib/VMCore/User.cpp
@@ -73,16 +73,9 @@ void *User::operator new(size_t s, unsigned Us) {
void User::operator delete(void *Usr) {
User *Start = static_cast<User*>(Usr);
Use *Storage = static_cast<Use*>(Usr) - Start->NumOperands;
- //
- // look for a variadic User
- if (Storage == Start->OperandList) {
- ::operator delete(Storage);
- return;
- }
- //
- // in all other cases just delete the nullary User (covers hung-off
- // uses also
- ::operator delete(Usr);
+ // If there were hung-off uses, they will have been freed already and
+ // NumOperands reset to 0, so here we just free the User itself.
+ ::operator delete(Storage);
}
} // End llvm namespace