[Object][ELF] ELFEntityIterator : Add operators for random access
authorShankar Easwaran <shankare@codeaurora.org>
Tue, 17 Mar 2015 15:44:20 +0000 (15:44 +0000)
committerShankar Easwaran <shankare@codeaurora.org>
Tue, 17 Mar 2015 15:44:20 +0000 (15:44 +0000)
Fix review comments from djasper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232494 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/ELF.h

index 0202e06990560c9cd7d4456fb51970132300d3ae..ddabf59f309e33a712f50a8ea08f23c5f52dfadb 100644 (file)
@@ -96,13 +96,13 @@ public:
 
     ELFEntityIterator &operator+(difference_type n) {
       assert(Current && "Attempted to increment an invalid iterator!");
-      Current += n;
+      Current += (n * EntitySize);
       return *this;
     }
 
     ELFEntityIterator &operator-(difference_type n) {
       assert(Current && "Attempted to subtract an invalid iterator!");
-      Current -= n;
+      Current -= (n * EntitySize);
       return *this;
     }