Skip to content

Commit

Permalink
[parser] Fix bug in scanner that caused parse errors in certain recur…
Browse files Browse the repository at this point in the history
…sive macro call scenarios.
  • Loading branch information
c-lipka committed Jan 14, 2019
1 parent f9e8bce commit b5c0c83
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions source/parser/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,14 +701,11 @@ UCS2String Scanner::BufferedSource::GetInputStreamName() const
bool Scanner::BufferedSource::SeekAndRefill(POV_OFF_T pos)
{
mBuffer.Clear();
if (mBase != pos)
{
bool seekOk = mpStream->seekg(pos);
mBase = mpStream->tellg();
POV_PARSER_ASSERT((mBase == pos) || !seekOk);
if (!seekOk)
return false; // TODO - Maybe report issue via an exception.
}
bool seekOk = mpStream->seekg(pos);
mBase = mpStream->tellg();
POV_PARSER_ASSERT((mBase == pos) || !seekOk);
if (!seekOk)
return false; // TODO - Maybe report issue via an exception.
mExhausted = false;
(void)RefillBuffer();
return true;
Expand Down

0 comments on commit b5c0c83

Please sign in to comment.