Index: src/PNaClTranslator.cpp |
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp |
index 0bba5c27ef78222d983084fa7dc2bafa3632346e..c73d9162b429fda3f4e2dde514e42add4688b9b2 100644 |
--- a/src/PNaClTranslator.cpp |
+++ b/src/PNaClTranslator.cpp |
@@ -782,7 +782,8 @@ bool BlockParserBaseClass::ErrorAt(naclbitc::ErrorLevel Level, uint64_t Bit, |
} else { |
StrBuf << Message; |
} |
- return Context->ErrorAt(Level, Bit, StrBuf.str()); |
+ return Context->ErrorAt(Level, Record.GetCursor().getErrorBitNo(Bit), |
+ StrBuf.str()); |
} |
void BlockParserBaseClass::reportRecordSizeError(size_t ExpectedSize, |
@@ -3114,7 +3115,8 @@ private: |
std::unique_ptr<Ice::Cfg> CfgParserWorkItem::getParsedCfg() { |
NaClBitstreamCursor &OldCursor(ModParser->getCursor()); |
- llvm::NaClBitstreamReader Reader(Buffer.get(), Buffer.get() + BufferSize, |
+ llvm::NaClBitstreamReader Reader(OldCursor.getStartWordByteForBit(StartBit), |
+ Buffer.get(), Buffer.get() + BufferSize, |
OldCursor.getBitStreamReader()); |
NaClBitstreamCursor NewCursor(Reader); |
NewCursor.JumpToBit(NewCursor.getWordBitNo(StartBit)); |