diff --git a/runtime/Cpp/runtime/src/BufferedTokenStream.cpp b/runtime/Cpp/runtime/src/BufferedTokenStream.cpp index 88ae3c01f..1015f3f18 100755 --- a/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +++ b/runtime/Cpp/runtime/src/BufferedTokenStream.cpp @@ -384,18 +384,17 @@ std::string BufferedTokenStream::getSourceName() const } std::string BufferedTokenStream::getText() { - lazyInit(); - fill(); return getText(misc::Interval(0U, size() - 1)); } std::string BufferedTokenStream::getText(const misc::Interval &interval) { + lazyInit(); + fill(); size_t start = interval.a; size_t stop = interval.b; if (start == INVALID_INDEX || stop == INVALID_INDEX) { return ""; } - lazyInit(); if (stop >= _tokens.size()) { stop = _tokens.size() - 1; }