diff options
Diffstat (limited to 'src/MoonP')
-rw-r--r-- | src/MoonP/moon_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp index 872e30e..58f8fb3 100644 --- a/src/MoonP/moon_parser.cpp +++ b/src/MoonP/moon_parser.cpp | |||
@@ -646,7 +646,7 @@ std::string ParseInfo::errorMessage(std::string_view msg, const input_range* loc | |||
646 | int oldCol = loc->m_begin.m_col; | 646 | int oldCol = loc->m_begin.m_col; |
647 | int col = std::max(0, oldCol - 1); | 647 | int col = std::max(0, oldCol - 1); |
648 | auto it = begin; | 648 | auto it = begin; |
649 | for (int i = 0; i < oldCol; ++i) { | 649 | for (int i = 0; i < oldCol && it != end; ++i) { |
650 | if (*it > ASCII) { | 650 | if (*it > ASCII) { |
651 | ++col; | 651 | ++col; |
652 | } | 652 | } |