[llvm-commits] [llvm] r49723 - /llvm/branches/ggreif/use-diet/include/llvm/User.h
Gabor Greif
ggreif at gmail.com
Tue Apr 15 04:47:32 PDT 2008
Author: ggreif
Date: Tue Apr 15 06:47:32 2008
New Revision: 49723
URL: http://llvm.org/viewvc/llvm-project?rev=49723&view=rev
Log:
do not manipulate the End iterator, but the one in front of it
Modified:
llvm/branches/ggreif/use-diet/include/llvm/User.h
Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49723&r1=49722&r2=49723&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/User.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 06:47:32 2008
@@ -338,8 +338,8 @@
AugmentedUse(); // not implemented
};
Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use)));
- AugmentedUse *End = static_cast<AugmentedUse*>(Begin + N);
- End->ref = addTag(this, tagOne);
+ Use *End = Begin + N;
+ static_cast<AugmentedUse&>(End[-1]).ref = addTag(this, tagOne);
Use::initTags(Begin, End);
return Begin;
}
More information about the llvm-commits
mailing list