From b5c0c83b722486b8bbc19a65b66e260c7024e2f8 Mon Sep 17 00:00:00 2001 From: Christoph Lipka Date: Mon, 14 Jan 2019 17:43:10 +0100 Subject: [PATCH] [parser] Fix bug in scanner that caused parse errors in certain recursive macro call scenarios. --- source/parser/scanner.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/source/parser/scanner.cpp b/source/parser/scanner.cpp index d0ef6eaf3..d065fa1ec 100644 --- a/source/parser/scanner.cpp +++ b/source/parser/scanner.cpp @@ -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;