From abc795d1f640be232d4b759aa0d519a0d84f32cd Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Tue, 17 Mar 2015 15:44:20 +0000 Subject: [PATCH] [Object][ELF] ELFEntityIterator : Add operators for random access 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index 0202e069905..ddabf59f309 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -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; }