llvm.org GIT mirror llvm / 547b2b7
Correctly handle skewed streams in drop_front() method. When calling BinaryStreamArray::drop_front(), if the stream is skewed it means we must never drop the first bytes of the stream since offsets which occur in records assume the existence of those bytes. So if we want to skip the first record in a stream, then what we really want to do is just set the begin pointer to the next record. But we shouldn't actually remove those bytes from the underlying view of the data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349066 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 5 months ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
138138 this->Skew = Skew;
139139 }
140140
141 void drop_front() { Stream = Stream.drop_front(begin()->length()); }
141 void drop_front() { Skew += begin()->length(); }
142142
143143 private:
144144 BinaryStreamRef Stream;