[llvm] r232494 - [Object][ELF] ELFEntityIterator : Add operators for random access

Shankar Easwaran shankare at codeaurora.org
Tue Mar 17 08:44:20 PDT 2015


Author: shankare
Date: Tue Mar 17 10:44:20 2015
New Revision: 232494

URL: http://llvm.org/viewvc/llvm-project?rev=232494&view=rev
Log:
[Object][ELF] ELFEntityIterator : Add operators for random access

Fix review comments from djasper.

Modified:
    llvm/trunk/include/llvm/Object/ELF.h

Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=232494&r1=232493&r2=232494&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Tue Mar 17 10:44:20 2015
@@ -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;
     }
 





More information about the llvm-commits mailing list