diff options
Diffstat (limited to 'llvm/lib/VMCore/User.cpp')
-rw-r--r-- | llvm/lib/VMCore/User.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/User.cpp b/llvm/lib/VMCore/User.cpp index f01fa349adf..9601da7011e 100644 --- a/llvm/lib/VMCore/User.cpp +++ b/llvm/lib/VMCore/User.cpp @@ -40,10 +40,8 @@ void User::replaceUsesOfWith(Value *From, Value *To) { //===----------------------------------------------------------------------===// Use *User::allocHungoffUses(unsigned N) const { - // Allocate the array of Uses, followed by a pointer (with bottom bit set) to - // the User. - size_t size = N * sizeof(Use) + sizeof(Use::UserRef); - Use *Begin = static_cast<Use*>(::operator new(size)); + Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N + + sizeof(Use::UserRef))); Use *End = Begin + N; (void) new(End) Use::UserRef(const_cast<User*>(this), 1); return Use::initTags(Begin, End); |